Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/inspector/uisourcecode-revisions.html |
| diff --git a/third_party/WebKit/LayoutTests/inspector/uisourcecode-revisions.html b/third_party/WebKit/LayoutTests/inspector/uisourcecode-revisions.html |
| index 4f09e840340ad13bd6c07cd3618eb010b6bc4632..8fd00fb85b9807cf80b84f1ca057958c3859f082 100644 |
| --- a/third_party/WebKit/LayoutTests/inspector/uisourcecode-revisions.html |
| +++ b/third_party/WebKit/LayoutTests/inspector/uisourcecode-revisions.html |
| @@ -19,7 +19,7 @@ function test() |
| } |
| return project; |
| } |
| - |
| + |
| function dumpUISourceCodeWithRevisions(uiSourceCode) |
| { |
| var content = uiSourceCode._content; |
| @@ -38,78 +38,82 @@ function test() |
| function testAddRevisionsRevertToOriginal(next) |
| { |
| var uiSourceCode = new Workspace.UISourceCode(createMockProject(), "url", Common.resourceTypes.Script); |
| - uiSourceCode.setWorkingCopy("content1"); |
| - uiSourceCode.setWorkingCopy("content2"); |
| - uiSourceCode.commitWorkingCopy(function() { }); |
| - |
| - InspectorTest.addResult("First revision added."); |
| - dumpUISourceCodeWithRevisions(uiSourceCode); |
| - uiSourceCode.setWorkingCopy("content3"); |
| - uiSourceCode.setWorkingCopy("content4"); |
| - uiSourceCode.commitWorkingCopy(function() { }); |
| + uiSourceCode.requestContent().then( () => { |
|
einbinder
2016/12/16 23:43:00
We need to signal our intention to use this uiSour
|
| + uiSourceCode.setWorkingCopy("content1"); |
| + uiSourceCode.setWorkingCopy("content2"); |
| + uiSourceCode.commitWorkingCopy(function() { }); |
| - InspectorTest.addResult("Second revision added."); |
| - dumpUISourceCodeWithRevisions(uiSourceCode); |
| - uiSourceCode.revertToOriginal().then(onReverted); |
| + InspectorTest.addResult("First revision added."); |
| + dumpUISourceCodeWithRevisions(uiSourceCode); |
| + uiSourceCode.setWorkingCopy("content3"); |
| + uiSourceCode.setWorkingCopy("content4"); |
| + uiSourceCode.commitWorkingCopy(function() { }); |
| - function onReverted() |
| - { |
| - InspectorTest.addResult("Reverted to original."); |
| + InspectorTest.addResult("Second revision added."); |
| dumpUISourceCodeWithRevisions(uiSourceCode); |
| - next(); |
| - } |
| + uiSourceCode.revertToOriginal().then(onReverted); |
| + |
| + function onReverted() |
| + { |
| + InspectorTest.addResult("Reverted to original."); |
| + dumpUISourceCodeWithRevisions(uiSourceCode); |
| + next(); |
| + } |
| + }); |
| }, |
| function testAddRevisionsRevertAndClearHistory(next) |
| { |
| var uiSourceCode = new Workspace.UISourceCode(createMockProject(), "url2", Common.resourceTypes.Script); |
| + uiSourceCode.requestContent().then( () => { |
| + uiSourceCode.setWorkingCopy("content1"); |
| + uiSourceCode.setWorkingCopy("content2"); |
| + uiSourceCode.commitWorkingCopy(function() { }); |
| - uiSourceCode.setWorkingCopy("content1"); |
| - uiSourceCode.setWorkingCopy("content2"); |
| - uiSourceCode.commitWorkingCopy(function() { }); |
| - |
| - InspectorTest.addResult("First revision added."); |
| - dumpUISourceCodeWithRevisions(uiSourceCode); |
| - uiSourceCode.setWorkingCopy("content3"); |
| - uiSourceCode.setWorkingCopy("content4"); |
| - uiSourceCode.commitWorkingCopy(function() { }); |
| - |
| - InspectorTest.addResult("Second revision added."); |
| - dumpUISourceCodeWithRevisions(uiSourceCode); |
| - uiSourceCode.revertAndClearHistory(revertedAndClearedHistory); |
| + InspectorTest.addResult("First revision added."); |
| + dumpUISourceCodeWithRevisions(uiSourceCode); |
| + uiSourceCode.setWorkingCopy("content3"); |
| + uiSourceCode.setWorkingCopy("content4"); |
| + uiSourceCode.commitWorkingCopy(function() { }); |
| - function revertedAndClearedHistory() |
| - { |
| - InspectorTest.addResult("Reverted and cleared history."); |
| + InspectorTest.addResult("Second revision added."); |
| dumpUISourceCodeWithRevisions(uiSourceCode); |
| - next(); |
| - } |
| + uiSourceCode.revertAndClearHistory(revertedAndClearedHistory); |
| + |
| + function revertedAndClearedHistory() |
| + { |
| + InspectorTest.addResult("Reverted and cleared history."); |
| + dumpUISourceCodeWithRevisions(uiSourceCode); |
| + next(); |
| + } |
| + }); |
| }, |
| function testAddRevisionsRevertToPrevious(next) |
| { |
| var uiSourceCode = new Workspace.UISourceCode(createMockProject(), "url3", Common.resourceTypes.Script); |
| + uiSourceCode.requestContent().then( () => { |
| + uiSourceCode.setWorkingCopy("content1"); |
| + uiSourceCode.setWorkingCopy("content2"); |
| + uiSourceCode.commitWorkingCopy(function() { }); |
| - uiSourceCode.setWorkingCopy("content1"); |
| - uiSourceCode.setWorkingCopy("content2"); |
| - uiSourceCode.commitWorkingCopy(function() { }); |
| - |
| - InspectorTest.addResult("First revision added."); |
| - dumpUISourceCodeWithRevisions(uiSourceCode); |
| - uiSourceCode.setWorkingCopy("content3"); |
| - uiSourceCode.setWorkingCopy("content4"); |
| - uiSourceCode.commitWorkingCopy(function() { }); |
| - |
| - InspectorTest.addResult("Second revision added."); |
| - dumpUISourceCodeWithRevisions(uiSourceCode); |
| - uiSourceCode.history[0].revertToThis().then(onReverted); |
| + InspectorTest.addResult("First revision added."); |
| + dumpUISourceCodeWithRevisions(uiSourceCode); |
| + uiSourceCode.setWorkingCopy("content3"); |
| + uiSourceCode.setWorkingCopy("content4"); |
| + uiSourceCode.commitWorkingCopy(function() { }); |
| - function onReverted() |
| - { |
| - InspectorTest.addResult("Reverted to previous revision."); |
| + InspectorTest.addResult("Second revision added."); |
| dumpUISourceCodeWithRevisions(uiSourceCode); |
| - next(); |
| - } |
| + uiSourceCode.history[0].revertToThis().then(onReverted); |
| + |
| + function onReverted() |
| + { |
| + InspectorTest.addResult("Reverted to previous revision."); |
| + dumpUISourceCodeWithRevisions(uiSourceCode); |
| + next(); |
| + } |
| + }); |
| }, |
| function testRequestContentAddRevisionsRevertToOriginal(next) |