Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(331)

Unified Diff: test/inspector/cpu-profiler/stop-without-preceeding-start.js

Issue 2891213002: [inspector] Refactor protocol-test.js (Closed)
Patch Set: comments addressed Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: test/inspector/cpu-profiler/stop-without-preceeding-start.js
diff --git a/test/inspector/cpu-profiler/stop-without-preceeding-start.js b/test/inspector/cpu-profiler/stop-without-preceeding-start.js
index 5fdf098fe1c8f687ffab108e89f6c4f37a54a6a3..5f21e653f1e9ecdab7a342e6663e894b58c4a5fd 100644
--- a/test/inspector/cpu-profiler/stop-without-preceeding-start.js
+++ b/test/inspector/cpu-profiler/stop-without-preceeding-start.js
@@ -2,11 +2,25 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-InspectorTest.log("Test that profiler doesn't crash when we call stop without preceeding start.");
+let {session, contextGroup, Protocol} = InspectorTest.start("Test that profiler doesn't crash when we call stop without preceeding start.");
Protocol.Profiler.stop().then(didStopProfile);
function didStopProfile(messageObject)
{
- InspectorTest.expectedError("ProfileAgent.stop", messageObject);
+ expectedError("ProfileAgent.stop", messageObject);
InspectorTest.completeTest();
}
+
+function checkExpectation(fail, name, messageObject)
+{
+ if (fail === !!messageObject.error) {
+ InspectorTest.log("PASS: " + name);
+ return true;
+ }
+
+ InspectorTest.log("FAIL: " + name + ": " + JSON.stringify(messageObject));
+ InspectorTest.completeTest();
+ return false;
+}
+var expectedSuccess = checkExpectation.bind(null, false);
+var expectedError = checkExpectation.bind(null, true);

Powered by Google App Engine
This is Rietveld 408576698