Revision b55e29597d92ab89063673f031151e2bdb4b9479 authored by Joe Downing on 22 March 2018, 07:35:35 UTC, committed by Chromium WPT Sync on 22 March 2018, 07:35:35 UTC
This change moves the KeyboardLock API methods to a 'keyboard'
namespace on the Navigator object.  We are doing this work now as
there has been a request for additional keyboard functionality that
would also be placed on the new keyboard object and we wanted to
move the KeyboardLock methods there for consistency before we launch.

KeyboardLock API Spec is here:
https://w3c.github.io/keyboard-lock/#API

Old calling pattern:
Navigator.keyboardLock();
Navigator.keyboardUnlock();

New calling pattern:
Navigator.keyboard.lock();
Navigator.keyboard.unlock();

Note: The main logic in the KeyboardLock.cpp class and tests is the
same as it was, however the file changed enough that git does not
recognize it as a file move.

BUG=680809

Change-Id: I234b2ab12d5ecd44c894ed5103863fd96fd548d4
Reviewed-on: https://chromium-review.googlesource.com/969656
Reviewed-by: Philip Jägenstedt <foolip@chromium.org>
Reviewed-by: Gary Kacmarcik <garykac@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#544996}
1 parent 1a8c195
Raw File
preflight-failure.htm
<!DOCTYPE html>
<meta charset=utf-8>
<title>CORS - Preflight responds with non-2XX status code</title>
<meta name=author title="Fernando Jiménez Moreno" href="mailto:ferjmoreno@gmail.com">

<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<script src=/common/get-host-info.sub.js></script>

<h1>Preflight responds with non-2XX status code</h1>

<div id=log></div>
<script>

// Request count for cache busting and easy identifying of request in traffic
// analyzer.
var req_c = 0;

var CROSSDOMAIN_URL = get_host_info().HTTP_REMOTE_ORIGIN + '/cors/resources/cors-makeheader.py?';

/*
 * Redirection with preflights.
 */
function preflight_failure(code) {
  var isCodeOK = code >= 200 && code <= 299,
      descOK = isCodeOK ? 'succeed' : 'throw error',
      desc = 'Should ' + descOK + ' if preflight has status ' + code;
  async_test(desc).step(function() {
    var client = new XMLHttpRequest();
    var redirect =
      encodeURIComponent(CROSSDOMAIN_URL + 'headers=x-test&' + req_c++);

    client.open('GET',
        CROSSDOMAIN_URL + 'headers=x-test&location=' + redirect
        + '&code=' + code + '&preflight=' + code
        + '&' + req_c++,
        true /* async */);
    client.setRequestHeader('x-test', 'test');
    client.onerror = this.step_func(function() {
      assert_false(isCodeOK);
      this.done();
    });
    client.onreadystatechange = this.step_func(function() {
      if (!isCodeOK)
        assert_equals(client.status, 0);
    });
    client.onload = this.step_func(function() {
      assert_true(isCodeOK);
      this.done();
    });
    client.send(null);
  });
}
[200, 299,
 300, 301, 302, 303, 304, 305, 306, 307, 308,
 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417,
 500, 501, 502, 503, 504, 505,
 680,
 790
].forEach(preflight_failure);

</script>
back to top