⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 254591 in webkit


Ignore:
Timestamp:
Jan 15, 2020, 11:14:50 AM (7 years ago)
Author:
Alan Coon
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

Location:
branches/safari-609-branch
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/safari-609-branch/LayoutTests/ChangeLog

    r254586 r254591  
     12020-01-14  Alan Coon  <alancoon@apple.com>
     2
     3        Cherry-pick r254145. rdar://problem/58552861
     4
     5    REGRESSION: [ Mac Debug ] inspector/page/setBootstrapScript-main-frame.html is a flaky failure
     6    https://bugs.webkit.org/show_bug.cgi?id=205807
     7    <rdar://problem/58344669>
     8   
     9    Reviewed by Dean Jackson.
     10   
     11    Source/WebInspectorUI:
     12   
     13    * UserInterface/Controllers/NetworkManager.js:
     14    (WI.NetworkManager.prototype.async createBootstrapScript):
     15    (WI.NetworkManager.prototype._handleBootstrapScriptContentDidChange):
     16    Ensure that `Page.setBootstrapScript` is called when restoring the bootstrap script from the
     17    IndexedDB storage. Otherwise, in situations like when Web Inspector is first opened, we will
     18    show the Inspector Bootstrap Script in the UI, but not actually set it on the inspected page.
     19   
     20    LayoutTests:
     21   
     22    * inspector/page/setBootstrapScript-main-frame.html:
     23    In addition to waiting for `Page.reload`, we should also wait for the page to actually load.
     24    Set the content of the bootstrap script during its creation instead of as a two step process.
     25    Avoid an assertion by setting the enabled state after the bootstrap script is initalized.
     26   
     27    * platform/mac/TestExpectations:
     28    Remove expectation added in r254059.
     29   
     30    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@254145 268f45cc-cd09-0410-ab3c-d52691b4dbfc
     31
     32    2020-01-07  Devin Rousso  <drousso@apple.com>
     33
     34            REGRESSION: [ Mac Debug ] inspector/page/setBootstrapScript-main-frame.html is a flaky failure
     35            https://bugs.webkit.org/show_bug.cgi?id=205807
     36            <rdar://problem/58344669>
     37
     38            Reviewed by Dean Jackson.
     39
     40            * inspector/page/setBootstrapScript-main-frame.html:
     41            In addition to waiting for `Page.reload`, we should also wait for the page to actually load.
     42            Set the content of the bootstrap script during its creation instead of as a two step process.
     43            Avoid an assertion by setting the enabled state after the bootstrap script is initalized.
     44
     45            * platform/mac/TestExpectations:
     46            Remove expectation added in r254059.
     47
    1482020-01-14  Alan Coon  <alancoon@apple.com>
    249
  • branches/safari-609-branch/LayoutTests/inspector/page/setBootstrapScript-main-frame.html

    r251531 r254591  
    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`);
  • branches/safari-609-branch/LayoutTests/platform/mac/TestExpectations

    r254583 r254591  
    19681968webkit.org/b/205757 webgl/1.0.3/conformance/textures/texture-upload-size.html [ Pass Timeout ]
    19691969
    1970 webkit.org/b/205807 [ Debug ] inspector/page/setBootstrapScript-main-frame.html [ Pass Failure ]
  • branches/safari-609-branch/Source/WebInspectorUI/ChangeLog

    r254171 r254591  
     12020-01-14  Alan Coon  <alancoon@apple.com>
     2
     3        Cherry-pick r254145. rdar://problem/58552861
     4
     5    REGRESSION: [ Mac Debug ] inspector/page/setBootstrapScript-main-frame.html is a flaky failure
     6    https://bugs.webkit.org/show_bug.cgi?id=205807
     7    <rdar://problem/58344669>
     8   
     9    Reviewed by Dean Jackson.
     10   
     11    Source/WebInspectorUI:
     12   
     13    * UserInterface/Controllers/NetworkManager.js:
     14    (WI.NetworkManager.prototype.async createBootstrapScript):
     15    (WI.NetworkManager.prototype._handleBootstrapScriptContentDidChange):
     16    Ensure that `Page.setBootstrapScript` is called when restoring the bootstrap script from the
     17    IndexedDB storage. Otherwise, in situations like when Web Inspector is first opened, we will
     18    show the Inspector Bootstrap Script in the UI, but not actually set it on the inspected page.
     19   
     20    LayoutTests:
     21   
     22    * inspector/page/setBootstrapScript-main-frame.html:
     23    In addition to waiting for `Page.reload`, we should also wait for the page to actually load.
     24    Set the content of the bootstrap script during its creation instead of as a two step process.
     25    Avoid an assertion by setting the enabled state after the bootstrap script is initalized.
     26   
     27    * platform/mac/TestExpectations:
     28    Remove expectation added in r254059.
     29   
     30    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@254145 268f45cc-cd09-0410-ab3c-d52691b4dbfc
     31
     32    2020-01-07  Devin Rousso  <drousso@apple.com>
     33
     34            REGRESSION: [ Mac Debug ] inspector/page/setBootstrapScript-main-frame.html is a flaky failure
     35            https://bugs.webkit.org/show_bug.cgi?id=205807
     36            <rdar://problem/58344669>
     37
     38            Reviewed by Dean Jackson.
     39
     40            * UserInterface/Controllers/NetworkManager.js:
     41            (WI.NetworkManager.prototype.async createBootstrapScript):
     42            (WI.NetworkManager.prototype._handleBootstrapScriptContentDidChange):
     43            Ensure that `Page.setBootstrapScript` is called when restoring the bootstrap script from the
     44            IndexedDB storage. Otherwise, in situations like when Web Inspector is first opened, we will
     45            show the Inspector Bootstrap Script in the UI, but not actually set it on the inspected page.
     46
    1472020-01-07  Alan Coon  <alancoon@apple.com>
    248
  • branches/safari-609-branch/Source/WebInspectorUI/UserInterface/Controllers/NetworkManager.js

    r252614 r254591  
    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.