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

Unified Diff: third_party/WebKit/LayoutTests/inspector/changes/changes-sidebar.html

Issue 2772643002: DevTools: Changes View (Closed)
Patch Set: fix test 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/changes/changes-sidebar.html
diff --git a/third_party/WebKit/LayoutTests/inspector/changes/changes-sidebar.html b/third_party/WebKit/LayoutTests/inspector/changes/changes-sidebar.html
new file mode 100644
index 0000000000000000000000000000000000000000..6b346147a2e8461044a5b9acdfb4f567f38e1946
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/inspector/changes/changes-sidebar.html
@@ -0,0 +1,69 @@
+<html>
+<head>
+<script src="../../http/tests/inspector/inspector-test.js"></script>
+<script src="changes-test.js"></script>
+<script>
+
+function test() {
+ var fulfill = function(){};
+ var workspace = new Workspace.Workspace();
+ var project = new Bindings.ContentProviderBasedProject(workspace, "mockProject", Workspace.projectTypes.Network, "", false);
+ var workspaceDiff = new WorkspaceDiff.WorkspaceDiff(workspace);
+ InspectorTest.addSniffer(WorkspaceDiff.WorkspaceDiff.prototype, "_uiSourceCodeProcessedForTest", modifiedStatusChanged, true);
+
+ var uiSourceCodeList = new Changes.ChangesSidebar(workspaceDiff);
+
+ var firstUISC = addUISourceCode("first.css", ".first {color: red}");
+ var secondUISC = addUISourceCode("second.css", ".second {color: red}");
+ var thirdUISC = addUISourceCode("third.css", ".third {color: red}");
+ uiSourceCodeList.show(UI.inspectorView.element);
+
+ InspectorTest.runTestSuite([
+ function initialState(next) {
+ dumpAfterLoadingFinished().then(next);
+ },
+ function workingCopyChanged(next) {
+ firstUISC.setWorkingCopy(".first {color: blue}");
+ dumpAfterLoadingFinished().then(next);
+ },
+ function workingCopyComitted(next) {
+ firstUISC.commitWorkingCopy();
+ secondUISC.addRevision(".second {color: blue}");
+ dumpAfterLoadingFinished().then(next);
+ },
+ function resetAll(next) {
+ firstUISC.addRevision(".first {color: red}");
+ secondUISC.addRevision(".second {color: red}");
+ thirdUISC.addRevision(".third {color: red}");
+ dumpAfterLoadingFinished().then(next);
+ }
+
+ ]);
+
+ function modifiedStatusChanged() {
+ if (!workspaceDiff._loadingUISourceCodes.size)
+ fulfill();
+ }
+
+ function dumpUISourceCodeList() {
+ uiSourceCodeList._treeoutline.rootElement().children().forEach(treeElement => {
+ InspectorTest.addResult(treeElement.title);
+ });
+ }
+
+ function dumpAfterLoadingFinished() {
+ var promise = new Promise(x => fulfill = x);
+ modifiedStatusChanged();
+ return promise.then(dumpUISourceCodeList);
+ }
+
+ function addUISourceCode(url, content) {
+ return project.addContentProvider(url, Common.StaticContentProvider.fromString(url, Common.resourceTypes.Stylesheet, content));
+ }
+}
+</script>
+</head>
+<body onload="runTest()">
+<p>Tests that the changes sidebar contains the changed uisourcecodes.</p>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698