Changeset 254145 in webkit


Ignore:
Timestamp:
Jan 7, 2020, 12:17:41 PM (6 years ago)
Author:
Devin Rousso
Message:

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.

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r254139 r254145  
     12020-01-07  Devin Rousso  <drousso@apple.com>
     2
     3        REGRESSION: [ Mac Debug ] inspector/page/setBootstrapScript-main-frame.html is a flaky failure
     4        https://bugs.webkit.org/show_bug.cgi?id=205807
     5        <rdar://problem/58344669>
     6
     7        Reviewed by Dean Jackson.
     8
     9        * inspector/page/setBootstrapScript-main-frame.html:
     10        In addition to waiting for `Page.reload`, we should also wait for the page to actually load.
     11        Set the content of the bootstrap script during its creation instead of as a two step process.
     12        Avoid an assertion by setting the enabled state after the bootstrap script is initalized.
     13
     14        * platform/mac/TestExpectations:
     15        Remove expectation added in r254059.
     16
    1172020-01-07  Truitt Savell  <tsavell@apple.com>
    218
  • trunk/LayoutTests/inspector/page/setBootstrapScript-main-frame.html

    r251531 r254145  
    1212        description: "Test that the bootstrap script is executed in the main frame.",
    1313        async test() {
     14            InspectorTest.assert(!WI.networkManager.bootstrapScript, "Should not already have a bootstrap script.");
     15
    1416            let valueBeforeBootstrapScript = await InspectorTest.evaluateInPage(`window.valueFromBootstrapScript`);
    1517            InspectorTest.expectEqual(valueBeforeBootstrapScript, undefined, "'valueFromBootstrapScript' should be 'undefined'.");
    1618
    1719            InspectorTest.log("Setting bootstrap script...");
    18             await WI.networkManager.createBootstrapScript();
     20            await WI.networkManager.createBootstrapScript(`window.valueFromBootstrapScript = 42;`);
    1921            WI.networkManager.bootstrapScriptEnabled = true;
    20             WI.networkManager.bootstrapScript.currentRevision.updateRevisionContent(`window.valueFromBootstrapScript = 42;`);
    2122
    2223            InspectorTest.log("Reloading page...");
    23             await InspectorTest.reloadPage();
    24 
    25             await Promise.delay(10);
     24            await Promise.all([
     25                InspectorTest.awaitEvent(FrontendTestHarness.Event.TestPageDidLoad),
     26                InspectorTest.reloadPage(),
     27            ]);
    2628
    2729            let valueAfterBootstrapScript = await InspectorTest.evaluateInPage(`window.valueFromBootstrapScript`);
  • trunk/LayoutTests/platform/mac/TestExpectations

    r254139 r254145  
    19641964webkit.org/b/205756 webgl/2.0.0/conformance2/glsl3/no-attribute-vertex-shader.html [ Pass Failure ]
    19651965
    1966 webkit.org/b/205807 [ Debug ] inspector/page/setBootstrapScript-main-frame.html [ Pass Failure ]
    1967 
    19681966webkit.org/b/205862 [ Mojave+ ] webgpu/whlsl/while-loop-break.html [ Pass ImageOnlyFailure ]
    19691967webkit.org/b/205865 [ Mojave+ ] webgpu/whlsl/ensure-proper-variable-lifetime-2.html [ Pass ImageOnlyFailure ]
  • trunk/Source/WebInspectorUI/ChangeLog

    r254111 r254145  
     12020-01-07  Devin Rousso  <drousso@apple.com>
     2
     3        REGRESSION: [ Mac Debug ] inspector/page/setBootstrapScript-main-frame.html is a flaky failure
     4        https://bugs.webkit.org/show_bug.cgi?id=205807
     5        <rdar://problem/58344669>
     6
     7        Reviewed by Dean Jackson.
     8
     9        * UserInterface/Controllers/NetworkManager.js:
     10        (WI.NetworkManager.prototype.async createBootstrapScript):
     11        (WI.NetworkManager.prototype._handleBootstrapScriptContentDidChange):
     12        Ensure that `Page.setBootstrapScript` is called when restoring the bootstrap script from the
     13        IndexedDB storage. Otherwise, in situations like when Web Inspector is first opened, we will
     14        show the Inspector Bootstrap Script in the UI, but not actually set it on the inspected page.
     15
    1162020-01-06  Yury Semikhatsky  <yurys@chromium.org>
    217
  • trunk/Source/WebInspectorUI/UserInterface/Controllers/NetworkManager.js

    r252614 r254145  
    325325        this._bootstrapScript = new WI.LocalScript(target, url, sourceURL, WI.Script.SourceType.Program, source, {injected: true, editable: true});
    326326        this._bootstrapScript.addEventListener(WI.SourceCode.Event.ContentDidChange, this._handleBootstrapScriptContentDidChange, this);
    327 
    328         if (!this._bootstrapScript.content)
    329             WI.objectStores.general.put("", NetworkManager.bootstrapScriptSourceObjectStoreKey);
     327        this._handleBootstrapScriptContentDidChange();
    330328
    331329        this.dispatchEventToListeners(NetworkManager.Event.BootstrapScriptCreated, {bootstrapScript: this._bootstrapScript});
     
    14321430    _handleBootstrapScriptContentDidChange(event)
    14331431    {
    1434         let source = this._bootstrapScript.content;
     1432        let source = this._bootstrapScript.content || "";
    14351433
    14361434        WI.objectStores.general.put(source, NetworkManager.bootstrapScriptSourceObjectStoreKey);
Note: See TracChangeset for help on using the changeset viewer.