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

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

Issue 2772643002: DevTools: Changes View (Closed)
Patch Set: 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-file-list.html
diff --git a/third_party/WebKit/LayoutTests/inspector/changes/changes-file-list.html b/third_party/WebKit/LayoutTests/inspector/changes/changes-file-list.html
new file mode 100644
index 0000000000000000000000000000000000000000..660f0a8d9a3d50470003cb51c97d30556693aa5f
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/inspector/changes/changes-file-list.html
@@ -0,0 +1,73 @@
+<html>
+<head>
+<script src="../../http/tests/inspector/inspector-test.js"></script>
+<script>
+var initialize_Changes = function()
+{
+ InspectorTest.preloadModule("changes");
+}
+
+function test() {
+ var fulfill = function(){};
+ var workspace = new Workspace.Workspace();
+ var project = new Bindings.ContentProviderBasedProject(workspace, "mockProject");
+ var workspaceDiff = new WorkspaceDiff.WorkspaceDiff(workspace);
+ InspectorTest.addSniffer(WorkspaceDiff.WorkspaceDiff.prototype, "_removeUISourceCode", modifiedStatusChanged, true);
+ InspectorTest.addSniffer(WorkspaceDiff.WorkspaceDiff.prototype, "_addUISourceCode", modifiedStatusChanged, true);
+
+ var fileList = new Changes.FileList(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}");
+ fileList.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 dumpFileList() {
+ fileList._treeoutline.rootElement().children().forEach(treeElement => {
+ InspectorTest.addResult(treeElement.title);
+ });
+ }
+
+ function dumpAfterLoadingFinished() {
+ var promise = new Promise(x => fulfill = x);
+ modifiedStatusChanged();
+ return promise.then(dumpFileList);
+ }
+
+ 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 file list contains the changed files.</p>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698