Index: chrome/browser/extensions/extension_bindings_apitest.cc |
diff --git a/chrome/browser/extensions/extension_bindings_apitest.cc b/chrome/browser/extensions/extension_bindings_apitest.cc |
index 9843e7ff430b7cc5976402ecf3b734fb91cc65e6..328cadbce80dcfcf12bc6effbfb4dfba774b4eec 100644 |
--- a/chrome/browser/extensions/extension_bindings_apitest.cc |
+++ b/chrome/browser/extensions/extension_bindings_apitest.cc |
@@ -8,12 +8,15 @@ |
#include "chrome/browser/extensions/extension_apitest.h" |
#include "chrome/browser/net/url_request_mock_util.h" |
#include "chrome/browser/ui/browser.h" |
+#include "chrome/browser/ui/tabs/tab_strip_model.h" |
+#include "chrome/test/base/ui_test_utils.h" |
#include "content/public/browser/browser_thread.h" |
#include "content/public/test/browser_test_utils.h" |
#include "extensions/browser/extension_host.h" |
#include "extensions/browser/process_manager.h" |
#include "extensions/test/extension_test_message_listener.h" |
#include "extensions/test/result_catcher.h" |
+#include "net/test/embedded_test_server/embedded_test_server.h" |
namespace extensions { |
namespace { |
@@ -111,5 +114,29 @@ IN_PROC_BROWSER_TEST_F(ExtensionBindingsApiTest, ModuleSystem) { |
ASSERT_TRUE(RunExtensionTest("bindings/module_system")) << message_; |
} |
+IN_PROC_BROWSER_TEST_F(ExtensionBindingsApiTest, NoExportOverriding) { |
+ ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); |
+ |
+ // We need to create runtime bindings in the web page. An extension that's |
+ // externally connectable will do that for us. |
+ ASSERT_TRUE(LoadExtension( |
+ test_data_dir_.AppendASCII("bindings") |
+ .AppendASCII("externally_connectable_everywhere"))); |
+ |
+ ui_test_utils::NavigateToURL( |
+ browser(), |
+ embedded_test_server()->GetURL( |
+ "/extensions/api_test/bindings/override_exports.html")); |
+ |
+ // See chrome/test/data/extensions/api_test/bindings/override_exports.html. |
+ std::string result; |
+ EXPECT_TRUE(content::ExecuteScriptAndExtractString( |
+ browser()->tab_strip_model()->GetActiveWebContents(), |
+ "window.domAutomationController.send(" |
+ "document.getElementById('status').textContent.trim());", |
+ &result)); |
+ EXPECT_EQ("success", result); |
+} |
+ |
} // namespace |
} // namespace extensions |