summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/presentation/presentationrequest.html
blob: d4b538c2fda08c92d618cc90abb9a24c805a1769 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<!DOCTYPE html>
<html>
<body>
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
<script src="../resources/gc.js"></script>
<script>

async_test(function(t) {
  var request = new PresentationRequest("http://example.com");
  request.start().catch(t.step_func(function(e) {
    assert_true(e instanceof DOMException);
    assert_equals(e.name, "InvalidAccessError");
    assert_equals(e.message, "PresentationRequest::start() requires user gesture.");
    t.done();
  }));
}, "Test that the PresentationRequest.start() requires user gesture.")

test(function() {
  navigator.presentation.defaultRequest = new PresentationRequest("http://example.com");
  navigator.presentation.defaultRequest.onconnectionavailable = function() {  };
  gc();
  assert_not_equals(navigator.presentation.defaultRequest.onconnectionavailable, undefined);
}, "Test that navigator.presentation.defaultRequest.onconnectionavailable isn't reset after gc()");

</script>
</body>
</html>