- Revision
- 254591
- Author
- alanc...@apple.com
- Date
- 2020-01-15 11:14:50 -0800 (Wed, 15 Jan 2020)
Log Message
Cherry-pick r254145. rdar://problem/58552861
REGRESSION: [ Mac Debug ] inspector/page/setBootstrapScript-main-frame.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=205807
<rdar://problem/58344669>
Reviewed by Dean Jackson.
Source/WebInspectorUI:
* UserInterface/Controllers/NetworkManager.js:
(WI.NetworkManager.prototype.async createBootstrapScript):
(WI.NetworkManager.prototype._handleBootstrapScriptContentDidChange):
Ensure that `Page.setBootstrapScript` is called when restoring the bootstrap script from the
IndexedDB storage. Otherwise, in situations like when Web Inspector is first opened, we will
show the Inspector Bootstrap Script in the UI, but not actually set it on the inspected page.
LayoutTests:
* inspector/page/setBootstrapScript-main-frame.html:
In addition to waiting for `Page.reload`, we should also wait for the page to actually load.
Set the content of the bootstrap script during its creation instead of as a two step process.
Avoid an assertion by setting the enabled state after the bootstrap script is initalized.
* platform/mac/TestExpectations:
Remove expectation added in r254059.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@254145 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Modified Paths
Diff
Modified: branches/safari-609-branch/LayoutTests/ChangeLog (254590 => 254591)
--- branches/safari-609-branch/LayoutTests/ChangeLog 2020-01-15 19:14:47 UTC (rev 254590)
+++ branches/safari-609-branch/LayoutTests/ChangeLog 2020-01-15 19:14:50 UTC (rev 254591)
@@ -1,5 +1,52 @@
2020-01-14 Alan Coon <alanc...@apple.com>
+ Cherry-pick r254145. rdar://problem/58552861
+
+ REGRESSION: [ Mac Debug ] inspector/page/setBootstrapScript-main-frame.html is a flaky failure
+ https://bugs.webkit.org/show_bug.cgi?id=205807
+ <rdar://problem/58344669>
+
+ Reviewed by Dean Jackson.
+
+ Source/WebInspectorUI:
+
+ * UserInterface/Controllers/NetworkManager.js:
+ (WI.NetworkManager.prototype.async createBootstrapScript):
+ (WI.NetworkManager.prototype._handleBootstrapScriptContentDidChange):
+ Ensure that `Page.setBootstrapScript` is called when restoring the bootstrap script from the
+ IndexedDB storage. Otherwise, in situations like when Web Inspector is first opened, we will
+ show the Inspector Bootstrap Script in the UI, but not actually set it on the inspected page.
+
+ LayoutTests:
+
+ * inspector/page/setBootstrapScript-main-frame.html:
+ In addition to waiting for `Page.reload`, we should also wait for the page to actually load.
+ Set the content of the bootstrap script during its creation instead of as a two step process.
+ Avoid an assertion by setting the enabled state after the bootstrap script is initalized.
+
+ * platform/mac/TestExpectations:
+ Remove expectation added in r254059.
+
+ git-svn-id: https://svn.webkit.org/repository/webkit/trunk@254145 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+ 2020-01-07 Devin Rousso <drou...@apple.com>
+
+ REGRESSION: [ Mac Debug ] inspector/page/setBootstrapScript-main-frame.html is a flaky failure
+ https://bugs.webkit.org/show_bug.cgi?id=205807
+ <rdar://problem/58344669>
+
+ Reviewed by Dean Jackson.
+
+ * inspector/page/setBootstrapScript-main-frame.html:
+ In addition to waiting for `Page.reload`, we should also wait for the page to actually load.
+ Set the content of the bootstrap script during its creation instead of as a two step process.
+ Avoid an assertion by setting the enabled state after the bootstrap script is initalized.
+
+ * platform/mac/TestExpectations:
+ Remove expectation added in r254059.
+
+2020-01-14 Alan Coon <alanc...@apple.com>
+
Cherry-pick r254074. rdar://problem/58549078
REGRESSION: [r254042] pageoverlay/overlay- tests are failing in WK1
Modified: branches/safari-609-branch/LayoutTests/inspector/page/setBootstrapScript-main-frame.html (254590 => 254591)
--- branches/safari-609-branch/LayoutTests/inspector/page/setBootstrapScript-main-frame.html 2020-01-15 19:14:47 UTC (rev 254590)
+++ branches/safari-609-branch/LayoutTests/inspector/page/setBootstrapScript-main-frame.html 2020-01-15 19:14:50 UTC (rev 254591)
@@ -11,19 +11,21 @@
name: "Page.setBootstrapScript.MainFrame",
description: "Test that the bootstrap script is executed in the main frame.",
async test() {
+ InspectorTest.assert(!WI.networkManager.bootstrapScript, "Should not already have a bootstrap script.");
+
let valueBeforeBootstrapScript = await InspectorTest.evaluateInPage(`window.valueFromBootstrapScript`);
InspectorTest.expectEqual(valueBeforeBootstrapScript, undefined, "'valueFromBootstrapScript' should be 'undefined'.");
InspectorTest.log("Setting bootstrap script...");
- await WI.networkManager.createBootstrapScript();
+ await WI.networkManager.createBootstrapScript(`window.valueFromBootstrapScript = 42;`);
WI.networkManager.bootstrapScriptEnabled = true;
- WI.networkManager.bootstrapScript.currentRevision.updateRevisionContent(`window.valueFromBootstrapScript = 42;`);
InspectorTest.log("Reloading page...");
- await InspectorTest.reloadPage();
+ await Promise.all([
+ InspectorTest.awaitEvent(FrontendTestHarness.Event.TestPageDidLoad),
+ InspectorTest.reloadPage(),
+ ]);
- await Promise.delay(10);
-
let valueAfterBootstrapScript = await InspectorTest.evaluateInPage(`window.valueFromBootstrapScript`);
InspectorTest.expectEqual(valueAfterBootstrapScript, 42, "'valueFromBootstrapScript' should be '42'.");
},
Modified: branches/safari-609-branch/LayoutTests/platform/mac/TestExpectations (254590 => 254591)
--- branches/safari-609-branch/LayoutTests/platform/mac/TestExpectations 2020-01-15 19:14:47 UTC (rev 254590)
+++ branches/safari-609-branch/LayoutTests/platform/mac/TestExpectations 2020-01-15 19:14:50 UTC (rev 254591)
@@ -1967,4 +1967,3 @@
webkit.org/b/205757 webgl/1.0.3/conformance/textures/texture-upload-size.html [ Pass Timeout ]
-webkit.org/b/205807 [ Debug ] inspector/page/setBootstrapScript-main-frame.html [ Pass Failure ]
Modified: branches/safari-609-branch/Source/WebInspectorUI/ChangeLog (254590 => 254591)
--- branches/safari-609-branch/Source/WebInspectorUI/ChangeLog 2020-01-15 19:14:47 UTC (rev 254590)
+++ branches/safari-609-branch/Source/WebInspectorUI/ChangeLog 2020-01-15 19:14:50 UTC (rev 254591)
@@ -1,3 +1,49 @@
+2020-01-14 Alan Coon <alanc...@apple.com>
+
+ Cherry-pick r254145. rdar://problem/58552861
+
+ REGRESSION: [ Mac Debug ] inspector/page/setBootstrapScript-main-frame.html is a flaky failure
+ https://bugs.webkit.org/show_bug.cgi?id=205807
+ <rdar://problem/58344669>
+
+ Reviewed by Dean Jackson.
+
+ Source/WebInspectorUI:
+
+ * UserInterface/Controllers/NetworkManager.js:
+ (WI.NetworkManager.prototype.async createBootstrapScript):
+ (WI.NetworkManager.prototype._handleBootstrapScriptContentDidChange):
+ Ensure that `Page.setBootstrapScript` is called when restoring the bootstrap script from the
+ IndexedDB storage. Otherwise, in situations like when Web Inspector is first opened, we will
+ show the Inspector Bootstrap Script in the UI, but not actually set it on the inspected page.
+
+ LayoutTests:
+
+ * inspector/page/setBootstrapScript-main-frame.html:
+ In addition to waiting for `Page.reload`, we should also wait for the page to actually load.
+ Set the content of the bootstrap script during its creation instead of as a two step process.
+ Avoid an assertion by setting the enabled state after the bootstrap script is initalized.
+
+ * platform/mac/TestExpectations:
+ Remove expectation added in r254059.
+
+ git-svn-id: https://svn.webkit.org/repository/webkit/trunk@254145 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+ 2020-01-07 Devin Rousso <drou...@apple.com>
+
+ REGRESSION: [ Mac Debug ] inspector/page/setBootstrapScript-main-frame.html is a flaky failure
+ https://bugs.webkit.org/show_bug.cgi?id=205807
+ <rdar://problem/58344669>
+
+ Reviewed by Dean Jackson.
+
+ * UserInterface/Controllers/NetworkManager.js:
+ (WI.NetworkManager.prototype.async createBootstrapScript):
+ (WI.NetworkManager.prototype._handleBootstrapScriptContentDidChange):
+ Ensure that `Page.setBootstrapScript` is called when restoring the bootstrap script from the
+ IndexedDB storage. Otherwise, in situations like when Web Inspector is first opened, we will
+ show the Inspector Bootstrap Script in the UI, but not actually set it on the inspected page.
+
2020-01-07 Alan Coon <alanc...@apple.com>
Cherry-pick r254111. rdar://problem/58093690
Modified: branches/safari-609-branch/Source/WebInspectorUI/UserInterface/Controllers/NetworkManager.js (254590 => 254591)
--- branches/safari-609-branch/Source/WebInspectorUI/UserInterface/Controllers/NetworkManager.js 2020-01-15 19:14:47 UTC (rev 254590)
+++ branches/safari-609-branch/Source/WebInspectorUI/UserInterface/Controllers/NetworkManager.js 2020-01-15 19:14:50 UTC (rev 254591)
@@ -324,10 +324,8 @@
const sourceURL = NetworkManager.bootstrapScriptURL;
this._bootstrapScript = new WI.LocalScript(target, url, sourceURL, WI.Script.SourceType.Program, source, {injected: true, editable: true});
this._bootstrapScript.addEventListener(WI.SourceCode.Event.ContentDidChange, this._handleBootstrapScriptContentDidChange, this);
+ this._handleBootstrapScriptContentDidChange();
- if (!this._bootstrapScript.content)
- WI.objectStores.general.put("", NetworkManager.bootstrapScriptSourceObjectStoreKey);
-
this.dispatchEventToListeners(NetworkManager.Event.BootstrapScriptCreated, {bootstrapScript: this._bootstrapScript});
}
@@ -1431,7 +1429,7 @@
_handleBootstrapScriptContentDidChange(event)
{
- let source = this._bootstrapScript.content;
+ let source = this._bootstrapScript.content || "";
WI.objectStores.general.put(source, NetworkManager.bootstrapScriptSourceObjectStoreKey);