| 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 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 // See handler_function_type_checking.html. | 176 // See handler_function_type_checking.html. |
| 177 std::string result; | 177 std::string result; |
| 178 EXPECT_TRUE(content::ExecuteScriptAndExtractString( | 178 EXPECT_TRUE(content::ExecuteScriptAndExtractString( |
| 179 web_contents, | 179 web_contents, |
| 180 "window.domAutomationController.send(" | 180 "window.domAutomationController.send(" |
| 181 "document.getElementById('status').textContent.trim());", | 181 "document.getElementById('status').textContent.trim());", |
| 182 &result)); | 182 &result)); |
| 183 EXPECT_EQ("success", result); | 183 EXPECT_EQ("success", result); |
| 184 } | 184 } |
| 185 | 185 |
| 186 // Regression test for crbug.com/340382, which was having extension bindings |
| 187 // flakily undefined because the script context was improperly classified. |
| 188 // Thanks to jhawkins@ for the only known reliable repro. |
| 189 IN_PROC_BROWSER_TEST_F(ExtensionBindingsApiTest, |
| 190 RegressionTestForUndefinedBindings) { |
| 191 // This is important - likely because the signin page does crazy stuff. This |
| 192 // doesn't repro if we don't navigate to the signin page. |
| 193 ui_test_utils::NavigateToURL(browser(), GURL("chrome://chrome-signin")); |
| 194 |
| 195 ASSERT_TRUE(RunPlatformAppTest("bindings/chromei18nrepro")) << message_; |
| 196 } |
| 197 |
| 186 } // namespace | 198 } // namespace |
| 187 } // namespace extensions | 199 } // namespace extensions |
| OLD | NEW |