Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(350)

Side by Side Diff: chrome/browser/extensions/extension_bindings_apitest.cc

Issue 1433343003: [Extensions] Wait until the Window object is cleared before classifying contexts Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698