OLD | NEW |
1 <script> | 1 <script> |
| 2 var isToolstrip = 1; |
2 // This function is called from the C++ browser test. It does a basic sanity | 3 // This function is called from the C++ browser test. It does a basic sanity |
3 // test that we can call extension APIs. | 4 // test that we can call extension APIs. |
4 function testTabsAPI() { | 5 function testTabsAPI() { |
5 console.log(chrome.tabs); | 6 console.log(chrome.tabs); |
6 | 7 |
7 chrome.tabs.getAllInWindow(null, function(tabs) { | 8 chrome.tabs.getAllInWindow(null, function(tabs) { |
8 window.domAutomationController.send(tabs.length == 1); | 9 window.domAutomationController.send(tabs.length == 1); |
9 }); | 10 }); |
10 } | 11 } |
11 | 12 |
12 // This function is called from the C++ browser test. It tests the getLanguage | 13 // This function is called from the C++ browser test. It tests the getLanguage |
13 // function to make sure it can be used as an extension API. This will pass if | 14 // function to make sure it can be used as an extension API. This will pass if |
14 // the browser navigates to a page in French language before this is called. | 15 // the browser navigates to a page in French language before this is called. |
15 function testTabsLanguageAPI() { | 16 function testTabsLanguageAPI() { |
16 chrome.tabs.detectLanguage(null, function(language) { | 17 chrome.tabs.detectLanguage(null, function(language) { |
17 window.domAutomationController.send(language == 'fr'); | 18 window.domAutomationController.send(language == 'fr'); |
18 }); | 19 }); |
19 } | 20 } |
20 | 21 |
| 22 // This function is called from the C++ browser test. It tests the getToolstrips |
| 23 // function to make sure it can be used as an extension API. This will pass if |
| 24 // getToolstrips returns all toolstrip views. |
| 25 function testgetToolstripsAPI() { |
| 26 var views = chrome.extension.getToolstrips(); |
| 27 window.domAutomationController.send(views.length == 2 && |
| 28 views[0].isToolstrip == 1 && |
| 29 views[1].isToolstrip == 1); |
| 30 } |
| 31 |
| 32 // This function is called from the C++ browser test. It tests the |
| 33 // getBackgroundPage function to make sure it can be used as an extension API. |
| 34 // This will pass if getBackgroundPage returns background page view. |
| 35 function testgetBackgroundPageAPI() { |
| 36 var view = chrome.extension.getBackgroundPage(); |
| 37 window.domAutomationController.send(view != null && |
| 38 view.isBackgroundPage == 1); |
| 39 } |
| 40 |
| 41 // This function is called from the C++ browser test. It tests the |
| 42 // getTabContentses function to make sure it can be used as an extension API. |
| 43 // This will pass if getTabContentses returns tabcontent view. |
| 44 function testgetTabContentsesAPI() { |
| 45 var views = chrome.extension.getTabContentses(); |
| 46 window.domAutomationController.send(views.length == 1 && |
| 47 views[0].isTabContents == 1); |
| 48 } |
| 49 |
21 </script> | 50 </script> |
22 <select> | 51 <select> |
23 <option>one</option> | 52 <option>one</option> |
24 <option>two</option> | 53 <option>two</option> |
25 <option>three</option> | 54 <option>three</option> |
26 </select> | 55 </select> |
OLD | NEW |