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
idbobjectstore_createIndex7-event_order.htm
<!DOCTYPE html>
<meta charset="utf-8">
<title>IDBObjectStore.createIndex() - Event ordering for ConstraintError on request</title>
<link rel="author" href="mailto:odinho@opera.com" title="Odin Hørthe Omdal">
<meta rel=help href=http://odinho.html5.org/IndexedDB/spec/Overview.html#dfn-steps-for-aborting-a-transaction>
<meta rel=assert title="Unless error was set to null, create a DOMException object and set its name to error. Set transaction's error property to this newly created DOMException.">
<meta rel=assert title="If the transaction's request list contain any requests whose done flag is still false, abort the steps for asynchronously executing a request for each such request and queue a task to perform the following steps:">
<meta rel=assert title="set the request's error attribute to a DOMException with a type of AbortError.">
<meta rel=assert title="Dispatch an event at request. The event must use the Event interface and have its type set to 'error'. The event bubbles and is cancelable. The propagation path for the event is transaction's connection, then transaction and finally the request. There is no default action for the event.">
<meta rel=assert title="Queue up an operation to dispatch an event at transaction. The event must use the Event interface and have its type set to 'abort'. The event does bubble but is not cancelable. The propagation path for the event is transaction's connection and then transaction.">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="support.js"></script>

<script>
    // Transaction may fire window.onerror in some implementations.
    setup({allow_uncaught_exception:true});

    var db,
      events = [],
      t = async_test(document.title, {timeout: 10000})

    var open_rq = createdb(t);
    open_rq.onupgradeneeded = function(e) {
        db = e.target.result;
        var txn = e.target.transaction;
        db.onerror = log("db.error");
        db.onabort = log("db.abort");
        txn.onabort = log("transaction.abort")
        txn.onerror = log("transaction.error")
        txn.oncomplete = log("transaction.complete")

        var objStore = db.createObjectStore("store");

        var rq_add1 = objStore.add({ animal: "Unicorn" }, 1);
        rq_add1.onsuccess = log("rq_add1.success");
        rq_add1.onerror   = log("rq_add1.error");

        objStore.createIndex("index", "animal", { unique: true })

        var rq_add2 = objStore.add({ animal: "Unicorn" }, 2);
        rq_add2.onsuccess = log("rq_add2.success");
        rq_add2.onerror   = log("rq_add2.error");

        var rq_add3 = objStore.add({ animal: "Horse" }, 3);
        rq_add3.onsuccess = log("rq_add3.success");
        rq_add3.onerror   = log("rq_add3.error");
    }

    open_rq.onerror = function(e) {
        log("open_rq.error")(e);
        assert_array_equals(events, [ "rq_add1.success",

                                      "rq_add2.error: ConstraintError",
                                      "transaction.error: ConstraintError",
                                      "db.error: ConstraintError",

                                      "rq_add3.error: AbortError",
                                      "transaction.error: AbortError",
                                      "db.error: AbortError",

                                      "transaction.abort: ConstraintError",
                                      "db.abort: ConstraintError",

                                      "open_rq.error: AbortError" ],
                            "events");
        t.done();
    }

    function log(msg) {
        return function(e) {
            if(e && e.target && e.target.error)
                events.push(msg + ": " + e.target.error.name);
            else
                events.push(msg);
        };
    }
</script>

<div id="log"></div>
back to top