зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1680995 - Profiler gtests: Add some general checks - r=canaltinova
JSONOutputCheck now checks a few more properties, including thread contents, and sub-process profiles. Differential Revision: https://phabricator.services.mozilla.com/D98891
This commit is contained in:
Родитель
fba8be0f11
Коммит
90f7b56bf6
|
@ -148,13 +148,21 @@ static void JSONRootCheck(const Json::Value& aRoot,
|
||||||
EXPECT_HAS_JSON(meta["version"], UInt);
|
EXPECT_HAS_JSON(meta["version"], UInt);
|
||||||
EXPECT_HAS_JSON(meta["startTime"], Double);
|
EXPECT_HAS_JSON(meta["startTime"], Double);
|
||||||
|
|
||||||
|
EXPECT_HAS_JSON(aRoot["pages"], Array);
|
||||||
|
|
||||||
|
EXPECT_HAS_JSON(aRoot["profilerOverhead"], Object);
|
||||||
|
|
||||||
GET_JSON(threads, aRoot["threads"], Array);
|
GET_JSON(threads, aRoot["threads"], Array);
|
||||||
const Json::ArrayIndex threadCount = threads.size();
|
const Json::ArrayIndex threadCount = threads.size();
|
||||||
for (Json::ArrayIndex i = 0; i < threadCount; ++i) {
|
for (Json::ArrayIndex i = 0; i < threadCount; ++i) {
|
||||||
GET_JSON(thread, threads[i], Object);
|
GET_JSON(thread, threads[i], Object);
|
||||||
|
EXPECT_HAS_JSON(thread["processType"], String);
|
||||||
EXPECT_HAS_JSON(thread["name"], String);
|
EXPECT_HAS_JSON(thread["name"], String);
|
||||||
|
EXPECT_HAS_JSON(thread["registerTime"], Double);
|
||||||
EXPECT_HAS_JSON(thread["samples"], Object);
|
EXPECT_HAS_JSON(thread["samples"], Object);
|
||||||
EXPECT_HAS_JSON(thread["markers"], Object);
|
EXPECT_HAS_JSON(thread["markers"], Object);
|
||||||
|
EXPECT_HAS_JSON(thread["pid"], UInt);
|
||||||
|
EXPECT_HAS_JSON(thread["tid"], UInt);
|
||||||
EXPECT_HAS_JSON(thread["stackTable"], Object);
|
EXPECT_HAS_JSON(thread["stackTable"], Object);
|
||||||
EXPECT_HAS_JSON(thread["frameTable"], Object);
|
EXPECT_HAS_JSON(thread["frameTable"], Object);
|
||||||
EXPECT_HAS_JSON(thread["stringTable"], Array);
|
EXPECT_HAS_JSON(thread["stringTable"], Array);
|
||||||
|
@ -165,6 +173,18 @@ static void JSONRootCheck(const Json::Value& aRoot,
|
||||||
GET_JSON(thread0, threads[0], Object);
|
GET_JSON(thread0, threads[0], Object);
|
||||||
EXPECT_EQ_JSON(thread0["name"], String, "GeckoMain");
|
EXPECT_EQ_JSON(thread0["name"], String, "GeckoMain");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
EXPECT_HAS_JSON(aRoot["pausedRanges"], Array);
|
||||||
|
|
||||||
|
const Json::Value& processes = aRoot["processes"];
|
||||||
|
if (!processes.isNull()) {
|
||||||
|
ASSERT_TRUE(processes.isArray());
|
||||||
|
const Json::ArrayIndex processCount = processes.size();
|
||||||
|
for (Json::ArrayIndex i = 0; i < processCount; ++i) {
|
||||||
|
GET_JSON(process, processes[i], Object);
|
||||||
|
JSONRootCheck(process, aWithMainThread);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check that various expected top properties are in the JSON, and then call the
|
// Check that various expected top properties are in the JSON, and then call the
|
||||||
|
|
Загрузка…
Ссылка в новой задаче