OLD | NEW |
1 <style> | 1 <script> |
2 body { | 2 // This function is called from the C++ browser test. It does a basic sanity |
3 overflow: hidden; | 3 // test that we can call extension APIs. |
4 margin: 0 0 0 0; | 4 function testTabsAPI() { |
| 5 console.log(chrome.tabs); |
| 6 |
| 7 chrome.tabs.getAllInWindow(null, function(tabs) { |
| 8 window.domAutomationController.send(tabs.length == 1); |
| 9 }); |
5 } | 10 } |
6 | |
7 /* TODO: put the background style into body when | |
8 https://bugs.webkit.org/show_bug.cgi?id=18445 is fixed. */ | |
9 .content { | |
10 background: -webkit-gradient(linear, left top, left bottom, from(rgb(222, 234,
248)), to(rgb(237, 244, 252))); | |
11 padding: 1; | |
12 white-space: nowrap; | |
13 } | |
14 </style> | |
15 <body> | |
16 <div class="content"> | |
17 <script> | |
18 // ExtensionViewTest depends on this alert, even though it doesn't work in | |
19 // the real browser. | |
20 alert('Sir, I exist'); | |
21 console.log('Sir, I exist'); | |
22 | |
23 chromium.onconnect.addListener(function (port) { | |
24 port.onmessage.addListener(doOnMessage); | |
25 port.postMessage('extension onconnect: ' + port.tab.url); | |
26 }); | |
27 | |
28 function doOnMessage(msg, port) { | |
29 if (!port.didRespond) { | |
30 port.postMessage('extension msg ack: ' + msg); | |
31 port.didRespond = true; | |
32 } | |
33 } | |
34 </script> | 11 </script> |
35 <select> | 12 <select> |
36 <option>one</option> | 13 <option>one</option> |
37 <option>two</option> | 14 <option>two</option> |
38 <option>three</option> | 15 <option>three</option> |
39 </select> | 16 </select> |
40 </div> | |
41 </body> | |
OLD | NEW |