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

Unified Diff: third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/scripts-sorting.html

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
Index: third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/scripts-sorting.html
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/scripts-sorting.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/scripts-sorting.html
index df70caa4675d025bdd8d30893cf558e8aee91811..d59034c8fc0525e9c239983eda1d2a3ffe7482aa 100644
--- a/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/scripts-sorting.html
+++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/scripts-sorting.html
@@ -2,9 +2,10 @@
<head>
<script src="../../../http/tests/inspector/inspector-test.js"></script>
<script src="../../../http/tests/inspector/debugger-test.js"></script>
+<script src="../../../http/tests/inspector/page-mock.js"></script>
<script>
-function test()
+async function test()
{
function createNavigatorView(constructor)
{
@@ -18,16 +19,15 @@ function test()
Bindings.NetworkProject.forTarget(InspectorTest.mainTarget)._reset();
- var target2 = InspectorTest.createMockTarget("mock-target-1");
- SDK.ResourceTreeModel.fromTarget(target2)._cachedResourcesProcessed = true;
- SDK.ResourceTreeModel.fromTarget(target2)._frameAttached("42", 0);
- var frame = SDK.ResourceTreeModel.fromTarget(target2).mainFrame;
+ var pageMock = new InspectorTest.PageMock('http://example.com');
+ pageMock.disableDOMCapability();
+ InspectorTest.connectToPage('mock-target-1', pageMock);
var uiSourceCodes = [];
- function addUISourceCode(url, isContentScript)
+ async function addUISourceCode(url, isContentScript)
{
- var contentProvider = Common.StaticContentProvider.fromString(url, Common.resourceTypes.Script, "");
- var uiSourceCode = Bindings.NetworkProject.forTarget(target2).addFile(contentProvider, frame, isContentScript);
+ pageMock.evalScript(url, '', isContentScript);
+ var uiSourceCode = await InspectorTest.waitForUISourceCode(url);
uiSourceCodes.push(uiSourceCode);
}
@@ -58,21 +58,21 @@ function test()
"foo/path/bar.js?file=bar/zzz.js",
"foo/path/foo.js?file=bar/aaa.js" ];
for (var i = 0; i < scripts.length; ++i)
- addUISourceCode("http://foo.com/" + scripts[i]);
+ await addUISourceCode("http://foo.com/" + scripts[i]);
var scripts2 = [
"foo/path/bar.js?file=bar/zzz.js",
"foo/path/foo.js?file=bar/aaa.js" ];
for (var i = 0; i < scripts2.length; ++i)
- addUISourceCode("http://bar.com/" + scripts2[i]);
- addUISourceCode("*Non*URL*path");
+ await addUISourceCode("http://bar.com/" + scripts2[i]);
+ await addUISourceCode("*Non*URL*path");
var extensions = [
"extension-schema://extension-name/bar.js",
"extension-schema://extension-name/folder/baz.js" ];
for (var i = 0; i < extensions.length; ++i)
- addUISourceCode(extensions[i], true);
- addUISourceCode("*Another*Non*URL*path", true);
+ await addUISourceCode(extensions[i], true);
+ await addUISourceCode("*Another*Non*URL*path", true);
dumpScriptsList();
InspectorTest.completeTest();
}

Powered by Google App Engine
This is Rietveld 408576698