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

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: typo 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/inspector/page-mock.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 b7a4b9c5b792dda907ef6be2f932b3cbc3140227..15d5128298150452568c393ef9e078acc1f321d9 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,20 @@ InspectorTest.evaluateInPage = function(code, callback)
InspectorTest.RuntimeAgent.evaluate(code, "console", false, mycallback);
}
+InspectorTest.addScriptUISourceCode = function(url, content, isContentScript, worldId) {
+ content += '\n//# sourceURL=' + url;
+ if (isContentScript)
+ content = `testRunner.evaluateScriptInIsolatedWorld(${worldId}, \`${content}\`)`;
+ InspectorTest.evaluateInPagePromise(content);
+ return InspectorTest.waitForUISourceCode(url);
+}
+
+InspectorTest.addScriptForFrame = function(url, content, frame) {
+ content += '\n//# sourceURL=' + url;
+ var executionContext = InspectorTest.runtimeModel.executionContexts().find(context => context.frameId === frame.id);
+ InspectorTest.RuntimeAgent.evaluate(content, "console", false, false, executionContext.id, function() { });
+}
+
InspectorTest.evaluateInPagePromise = function(code)
{
return new Promise(succ => InspectorTest.evaluateInPage(code, succ));
@@ -451,12 +465,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)
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/inspector/page-mock.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698