summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/browsers/windows/browsing-context-names/choose-_parent-004.html
blob: c79378018a37eac74dc6d6556165de215fe05398 (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
29
30
31
32
33
34
35
36
37
38
39
40
<!DOCTYPE html>
<meta charset="utf-8">
<title>HTML Test: Choose browsing context - '_parent' (case-sensitivity)</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/common/PrefixedLocalStorage.js"></script>
<body>
<div id="log"></div>

<script>
var prefixedStorage;
var iframe;
setup(() => prefixedStorage = new PrefixedLocalStorageTest());

async_test(t => {
  t.add_cleanup(() => prefixedStorage.cleanup());
  var testFunc = (function (t) {
    var completed = 0;
    var testCount = 2;
    return function (actual, expected) {
      assert_equals(actual, expected);
      if (++completed >= testCount) {
        t.done();
      }
    }
  }(t));

  prefixedStorage.onSet('isTop', t.step_func(e => {
    testFunc(e.newValue, 'false');
  }));
  prefixedStorage.onSet('name', t.step_func(e => {
    testFunc(e.newValue, 'parentWin');
  }));
  iframe = document.createElement('iframe');
  iframe.src = prefixedStorage.url('resources/choose-_parent-004-iframe-1.html');
  iframe.name = 'parentWin';
  document.body.appendChild(iframe);
}, 'choosing _parent context should be case-insensitive');
</script>
</body>