Revision 61d3da36e6cb16e4d4b9375518b0ae00308ee92a authored by Nicolas Pena on 25 April 2018, 18:35:25 UTC, committed by Blink WPT Bot on 25 April 2018, 18:53:19 UTC
This CL changes the webtiming-resolution to test that resolution is
larger than 10 microseconds, instead of testing for a specific value.
This allows the test to no longer be flaky and to be moved to wpt.

The webtiming-ssl test is moved to WPT, using an https connection to
ensure that secureConnectionStart is correctly defined.

Bug: chromium:801341
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_mojo
Change-Id: I4d31faa08d00251098f3dc648c794d80bbcc2f22
Reviewed-on: https://chromium-review.googlesource.com/867310
Commit-Queue: Nicolás Peña Moreno <npm@chromium.org>
Reviewed-by: Robert Ma <robertma@chromium.org>
Reviewed-by: Timothy Dresser <tdresser@chromium.org>
Cr-Commit-Position: refs/heads/master@{#553666}
1 parent 3a0a2e4
Raw File
Document-open.html
<!doctype html>
<title>Selection Document.open() tests</title>
<div id=log></div>
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<script>
"use strict";

// This tests the HTML spec requirement "Replace the Document's singleton
// objects with new instances of those objects. (This includes in particular
// the Window, Location, History, ApplicationCache, and Navigator, objects, the
// various BarProp objects, the two Storage objects, the various HTMLCollection
// objects, and objects defined by other specifications, like Selection and the
// document's UndoManager. It also includes all the Web IDL prototypes in the
// JavaScript binding, including the Document object's prototype.)" in the
// document.open() algorithm.

var iframe = document.createElement("iframe");
var t = async_test("Selection must be replaced with a new object after document.open()");
iframe.onload = function() {
    t.step(function() {
        var originalSelection = iframe.contentWindow.getSelection();
        assert_equals(originalSelection.rangeCount, 0,
            "Sanity check: rangeCount must be initially 0");
        iframe.contentDocument.body.appendChild(
            iframe.contentDocument.createTextNode("foo"));
        var range = iframe.contentDocument.createRange();
        range.selectNodeContents(iframe.contentDocument.body);
        iframe.contentWindow.getSelection().addRange(range);
        assert_equals(originalSelection.rangeCount, 1,
            "Sanity check: rangeCount must be 1 after adding a range");

        iframe.contentDocument.open();

        assert_not_equals(iframe.contentWindow.getSelection(), originalSelection,
            "After document.open(), the Selection object must no longer be the same");
        assert_equals(iframe.contentWindow.getSelection().rangeCount, 0,
            "After document.open(), rangeCount must be 0 again");
    });
    t.done();
    document.body.removeChild(iframe);
};
document.body.appendChild(iframe);
</script>
back to top