Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / inspector / runtime / runtime-es6-setSymbolPropertyValue.html
1 <html>
2 <head>
3 <script src="../../http/tests/inspector/inspector-test.js"></script>
4 <script>
5
6 var object1 = { foo: 1 };
7 var symbol1 = Symbol("a");
8 object1[symbol1] = 2;
9
10 function dumpSymbolProperty(label)
11 {
12     console.log("===== " + label + " =====");
13     console.log(object1[symbol1]);
14     console.log("");
15 }
16
17 function test()
18 {
19     var obj1, name;
20
21     InspectorTest.runTestSuite([
22         function testSetUp(next)
23         {
24             InspectorTest.evaluateInPage("dumpSymbolProperty('Initial')", step0);
25
26             function step0()
27             {
28                 RuntimeAgent.evaluate("object1", step1);
29             }
30
31             function step1(error, result, wasThrown)
32             {
33                 obj1 = WebInspector.runtimeModel.createRemoteObject(result);
34                 RuntimeAgent.evaluate("symbol1", step2);
35             }
36
37             function step2(error, result, wasThrown)
38             {
39                 name = WebInspector.RemoteObject.toCallArgument(WebInspector.runtimeModel.createRemoteObject(result));
40                 next();
41             }
42         },
43
44         function testSetSymbolPropertyValue(next)
45         {
46             obj1.setPropertyValue(name, "3", step1);
47
48             function step1()
49             {
50                 InspectorTest.evaluateInPage("dumpSymbolProperty('Set property')", next);
51             }
52         },
53
54         function testDeleteSymbolProperty(next)
55         {
56             obj1.deleteProperty(name, step1);
57
58             function step1()
59             {
60                 InspectorTest.evaluateInPage("dumpSymbolProperty('Delete property')", next);
61             }
62         }
63     ]);
64 }
65
66 </script>
67 </head>
68
69 <body onload="runTest()">
70 <p>
71 Tests editing Symbol properties.
72 </p>
73
74 </body>
75 </html>