| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Contains holistic tests of the bindings infrastructure | 5 // Contains holistic tests of the bindings infrastructure |
| 6 | 6 |
| 7 #include "chrome/browser/extensions/api/permissions/permissions_api.h" | 7 #include "chrome/browser/extensions/api/permissions/permissions_api.h" |
| 8 #include "chrome/browser/extensions/extension_apitest.h" | 8 #include "chrome/browser/extensions/extension_apitest.h" |
| 9 #include "chrome/browser/net/url_request_mock_util.h" | 9 #include "chrome/browser/net/url_request_mock_util.h" |
| 10 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 // See chrome/test/data/extensions/api_test/bindings/override_exports.html. | 131 // See chrome/test/data/extensions/api_test/bindings/override_exports.html. |
| 132 std::string result; | 132 std::string result; |
| 133 EXPECT_TRUE(content::ExecuteScriptAndExtractString( | 133 EXPECT_TRUE(content::ExecuteScriptAndExtractString( |
| 134 browser()->tab_strip_model()->GetActiveWebContents(), | 134 browser()->tab_strip_model()->GetActiveWebContents(), |
| 135 "window.domAutomationController.send(" | 135 "window.domAutomationController.send(" |
| 136 "document.getElementById('status').textContent.trim());", | 136 "document.getElementById('status').textContent.trim());", |
| 137 &result)); | 137 &result)); |
| 138 EXPECT_EQ("success", result); | 138 EXPECT_EQ("success", result); |
| 139 } | 139 } |
| 140 | 140 |
| 141 IN_PROC_BROWSER_TEST_F(ExtensionBindingsApiTest, HandlerFunctionTypeChecking) { |
| 142 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); |
| 143 ui_test_utils::NavigateToURL( |
| 144 browser(), |
| 145 embedded_test_server()->GetURL( |
| 146 "/extensions/api_test/bindings/handler_function_type_checking.html")); |
| 147 content::WebContents* web_contents = |
| 148 browser()->tab_strip_model()->GetActiveWebContents(); |
| 149 EXPECT_FALSE(web_contents->IsCrashed()); |
| 150 // See handler_function_type_checking.html. |
| 151 std::string result; |
| 152 EXPECT_TRUE(content::ExecuteScriptAndExtractString( |
| 153 web_contents, |
| 154 "window.domAutomationController.send(" |
| 155 "document.getElementById('status').textContent.trim());", |
| 156 &result)); |
| 157 EXPECT_EQ("success", result); |
| 158 } |
| 159 |
| 141 } // namespace | 160 } // namespace |
| 142 } // namespace extensions | 161 } // namespace extensions |
| OLD | NEW |