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 #include "base/logging.h" | 5 #include "base/logging.h" |
6 #include "chrome/browser/extensions/extension_apitest.h" | 6 #include "chrome/browser/extensions/extension_apitest.h" |
7 #include "chrome/browser/extensions/extension_service.h" | 7 #include "chrome/browser/extensions/extension_service.h" |
8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
9 #include "chrome/browser/ui/browser.h" | 9 #include "chrome/browser/ui/browser.h" |
10 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 10 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 IN_PROC_BROWSER_TEST_F(ExtensionIconSourceTest, MAYBE_IconsLoadedIncognito) { | 85 IN_PROC_BROWSER_TEST_F(ExtensionIconSourceTest, MAYBE_IconsLoadedIncognito) { |
86 base::FilePath basedir = test_data_dir_.AppendASCII("icons"); | 86 base::FilePath basedir = test_data_dir_.AppendASCII("icons"); |
87 ASSERT_TRUE(LoadExtensionIncognito( | 87 ASSERT_TRUE(LoadExtensionIncognito( |
88 basedir.AppendASCII("extension_with_permission"))); | 88 basedir.AppendASCII("extension_with_permission"))); |
89 ASSERT_TRUE(LoadExtensionIncognito( | 89 ASSERT_TRUE(LoadExtensionIncognito( |
90 basedir.AppendASCII("extension_no_permission"))); | 90 basedir.AppendASCII("extension_no_permission"))); |
91 std::string result; | 91 std::string result; |
92 | 92 |
93 // Test that the icons are loaded and that the chrome://extension-icon | 93 // Test that the icons are loaded and that the chrome://extension-icon |
94 // parameters work correctly. | 94 // parameters work correctly. |
95 Browser* otr_browser = ui_test_utils::OpenURLOffTheRecord( | 95 Browser* otr_browser = OpenURLOffTheRecord( |
96 browser()->profile(), | 96 browser()->profile(), |
97 GURL("chrome-extension://gbmgkahjioeacddebbnengilkgbkhodg/index.html")); | 97 GURL("chrome-extension://gbmgkahjioeacddebbnengilkgbkhodg/index.html")); |
98 ASSERT_TRUE(content::ExecuteScriptAndExtractString( | 98 ASSERT_TRUE(content::ExecuteScriptAndExtractString( |
99 otr_browser->tab_strip_model()->GetActiveWebContents(), | 99 otr_browser->tab_strip_model()->GetActiveWebContents(), |
100 "window.domAutomationController.send(document.title)", | 100 "window.domAutomationController.send(document.title)", |
101 &result)); | 101 &result)); |
102 EXPECT_EQ(result, "Loaded"); | 102 EXPECT_EQ(result, "Loaded"); |
103 | 103 |
104 // Verify that the an extension can't load chrome://extension-icon icons | 104 // Verify that the an extension can't load chrome://extension-icon icons |
105 // without the management permission. | 105 // without the management permission. |
106 ui_test_utils::OpenURLOffTheRecord( | 106 OpenURLOffTheRecord( |
107 browser()->profile(), | 107 browser()->profile(), |
108 GURL("chrome-extension://apocjbpjpkghdepdngjlknfpmabcmlao/index.html")); | 108 GURL("chrome-extension://apocjbpjpkghdepdngjlknfpmabcmlao/index.html")); |
109 ASSERT_TRUE(content::ExecuteScriptAndExtractString( | 109 ASSERT_TRUE(content::ExecuteScriptAndExtractString( |
110 otr_browser->tab_strip_model()->GetActiveWebContents(), | 110 otr_browser->tab_strip_model()->GetActiveWebContents(), |
111 "window.domAutomationController.send(document.title)", | 111 "window.domAutomationController.send(document.title)", |
112 &result)); | 112 &result)); |
113 EXPECT_EQ(result, "Not Loaded"); | 113 EXPECT_EQ(result, "Not Loaded"); |
114 } | 114 } |
OLD | NEW |