| 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 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 // See handler_function_type_checking.html. | 150 // See handler_function_type_checking.html. |
| 151 std::string result; | 151 std::string result; |
| 152 EXPECT_TRUE(content::ExecuteScriptAndExtractString( | 152 EXPECT_TRUE(content::ExecuteScriptAndExtractString( |
| 153 web_contents, | 153 web_contents, |
| 154 "window.domAutomationController.send(" | 154 "window.domAutomationController.send(" |
| 155 "document.getElementById('status').textContent.trim());", | 155 "document.getElementById('status').textContent.trim());", |
| 156 &result)); | 156 &result)); |
| 157 EXPECT_EQ("success", result); | 157 EXPECT_EQ("success", result); |
| 158 } | 158 } |
| 159 | 159 |
| 160 // Regression test for crbug.com/340382, which was having extension bindings |
| 161 // flakily undefined because the script context was improperly classified. |
| 162 // Thanks to jhawkins@ for the only known reliable repro. |
| 163 IN_PROC_BROWSER_TEST_F(ExtensionBindingsApiTest, |
| 164 RegressionTestForUndefinedBindings) { |
| 165 // This is important - likely because the signin page does crazy stuff. This |
| 166 // doesn't repro if we don't navigate to the signin page. |
| 167 ui_test_utils::NavigateToURL(browser(), GURL("chrome://chrome-signin")); |
| 168 |
| 169 ASSERT_TRUE(RunPlatformAppTest("bindings/chromei18nrepro")) << message_; |
| 170 } |
| 171 |
| 160 } // namespace | 172 } // namespace |
| 161 } // namespace extensions | 173 } // namespace extensions |
| OLD | NEW |