summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/http/tests/security/cross-frame-access-custom.html
blob: 491144becb5ec0af4519a4f7b5a349a8d8900904 (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
41
42
43
44
45
46
47
48
49
50
<html>
<head>
    <script src="resources/cross-frame-access.js"></script>
</head>
<body>
<iframe src="http://localhost:8000/security/resources/cross-frame-iframe-for-get-test.html" style=""></iframe>
<pre id="console"></pre>
<script>

window.targetWindow = frames[0];

window.onload = function()
{
    if (window.testRunner)
        testRunner.dumpAsText();

    log("\n----- tests for getting/setting interesting properties -----\n");

    // built-in property
    shouldBeFalse("canGet('targetWindow.Object')");
    shouldBeFalse("canSet('targetWindow.Object')");

    // pre-existing custom property
    shouldBeFalse("canGet('targetWindow.existingCustomProperty')");
    shouldBeFalse("canSet('targetWindow.existingCustomProperty')");

    // new custom property
    shouldBeFalse("canSet('targetWindow.newCustomProperty')");

    // built-in prototype property
    shouldBeFalse("canGet('targetWindow.hasOwnProperty')");
    shouldBeFalse("canSet('targetWindow.hasOwnProperty')");

    // custom prototype property
    shouldBeFalse("canGet('targetWindow.windowPrototypeCustomProperty')");
    shouldBeFalse("canSet('targetWindow.windowPrototypeCustomProperty')");
    shouldBeFalse("canGet('targetWindow.objectPrototypeCustomProperty')");
    shouldBeFalse("canSet('targetWindow.objectPrototypeCustomProperty')");

    // window object itself
    shouldBeTrue("canGet('targetWindow.toString')");
    shouldBeFalse("canSet('targetWindow.toString')");
    shouldBe("toString('targetWindow', '')", "'[object Window]'");

    // Work around DRT bug that causes subsequent tests to fail.
    window.stop();
}
</script>
</body>
</html>