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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/inspector/inspector-test.js

Issue 2747863007: DevTools: clean up tests to not depend on NetworkProject.addFile method (Closed)
Patch Set: remove all networkProject.addFile calls Created 3 years, 9 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: third_party/WebKit/LayoutTests/http/tests/inspector/inspector-test.js
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/inspector-test.js b/third_party/WebKit/LayoutTests/http/tests/inspector/inspector-test.js
index 7fe44929c70d94e4401a8c62f982929a0c26b0f6..d2a226a4692c96fcb8e9e89d2454fb96353479f9 100644
--- a/third_party/WebKit/LayoutTests/http/tests/inspector/inspector-test.js
+++ b/third_party/WebKit/LayoutTests/http/tests/inspector/inspector-test.js
@@ -52,6 +52,14 @@ InspectorTest.evaluateInPage = function(code, callback)
InspectorTest.RuntimeAgent.evaluate(code, "console", false, mycallback);
}
+InspectorTest.addScriptUISourceCode = async function(url, content, isContentScript, worldId) {
dgozman 2017/03/16 00:17:09 I'm worried this whether this forces everyone usin
lushnikov 2017/03/16 06:30:49 Done. The async is actually not needed here.
+ content += '\n//# sourceURL=' + url;
+ if (isContentScript)
+ content = `testRunner.evaluateScriptInIsolatedWorld(${worldId}, \`${content}\`)`;
dgozman 2017/03/16 00:17:09 Nice one!
lushnikov 2017/03/16 06:30:49 Thanks!
+ InspectorTest.evaluateInPagePromise(content)
dgozman 2017/03/16 00:17:09 nit: missing semicolon
lushnikov 2017/03/16 06:30:49 Done.
+ return InspectorTest.waitForUISourceCode(url);
+}
+
InspectorTest.evaluateInPagePromise = function(code)
{
return new Promise(succ => InspectorTest.evaluateInPage(code, succ));
@@ -451,12 +459,6 @@ InspectorTest.waitForUISourceCodeRemoved = function(callback)
}
}
-InspectorTest._mockTargetId = 1;
-InspectorTest.createMockTarget = function(name, capabilities, dontAttachToMain)
-{
- return SDK.targetManager.createTarget('mock-target-' + InspectorTest._mockTargetId++, name, capabilities || SDK.Target.Capability.AllForTests, params => new SDK.StubConnection(params), dontAttachToMain ? null : InspectorTest.mainTarget);
-}
-
InspectorTest.assertGreaterOrEqual = function(a, b, message)
{
if (a < b)

Powered by Google App Engine
This is Rietveld 408576698