| 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 "chrome/browser/content_settings/host_content_settings_map.h" | 5 #include "chrome/browser/content_settings/host_content_settings_map.h" |
| 6 #include "chrome/browser/extensions/extension_browsertest.h" | 6 #include "chrome/browser/extensions/extension_browsertest.h" |
| 7 #include "chrome/browser/extensions/extension_service.h" | 7 #include "chrome/browser/extensions/extension_service.h" |
| 8 #include "chrome/browser/prefs/pref_service.h" | 8 #include "chrome/browser/prefs/pref_service.h" |
| 9 #include "chrome/browser/ui/browser.h" | 9 #include "chrome/browser/ui/browser.h" |
| 10 #include "chrome/browser/ui/browser_commands.h" | 10 #include "chrome/browser/ui/browser_commands.h" |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 | 64 |
| 65 ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( | 65 ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( |
| 66 tab->GetRenderViewHost(), L"", L"testPluginWorks()", &result)); | 66 tab->GetRenderViewHost(), L"", L"testPluginWorks()", &result)); |
| 67 EXPECT_FALSE(result); | 67 EXPECT_FALSE(result); |
| 68 | 68 |
| 69 // If we reload the extension and page, it should work again. | 69 // If we reload the extension and page, it should work again. |
| 70 | 70 |
| 71 ASSERT_TRUE(LoadExtension(extension_dir)); | 71 ASSERT_TRUE(LoadExtension(extension_dir)); |
| 72 EXPECT_EQ(size_before + 1, service->extensions()->size()); | 72 EXPECT_EQ(size_before + 1, service->extensions()->size()); |
| 73 { | 73 { |
| 74 ui_test_utils::WindowedNotificationObserver observer( | 74 content::WindowedNotificationObserver observer( |
| 75 content::NOTIFICATION_LOAD_STOP, | 75 content::NOTIFICATION_LOAD_STOP, |
| 76 content::Source<NavigationController>( | 76 content::Source<NavigationController>( |
| 77 &chrome::GetActiveWebContents(browser())->GetController())); | 77 &chrome::GetActiveWebContents(browser())->GetController())); |
| 78 chrome::Reload(browser(), CURRENT_TAB); | 78 chrome::Reload(browser(), CURRENT_TAB); |
| 79 observer.Wait(); | 79 observer.Wait(); |
| 80 } | 80 } |
| 81 ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( | 81 ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( |
| 82 tab->GetRenderViewHost(), L"", L"testPluginWorks()", &result)); | 82 tab->GetRenderViewHost(), L"", L"testPluginWorks()", &result)); |
| 83 // We don't allow extension plugins to run on ChromeOS. | 83 // We don't allow extension plugins to run on ChromeOS. |
| 84 #if defined(OS_CHROMEOS) | 84 #if defined(OS_CHROMEOS) |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 EXPECT_TRUE(result); | 133 EXPECT_TRUE(result); |
| 134 #endif | 134 #endif |
| 135 | 135 |
| 136 // Now load it through a file URL. The plugin should not load. | 136 // Now load it through a file URL. The plugin should not load. |
| 137 ui_test_utils::NavigateToURL(browser(), | 137 ui_test_utils::NavigateToURL(browser(), |
| 138 net::FilePathToFileURL(extension_dir.AppendASCII("test.html"))); | 138 net::FilePathToFileURL(extension_dir.AppendASCII("test.html"))); |
| 139 ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( | 139 ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( |
| 140 tab->GetRenderViewHost(), L"", L"testPluginWorks()", &result)); | 140 tab->GetRenderViewHost(), L"", L"testPluginWorks()", &result)); |
| 141 EXPECT_FALSE(result); | 141 EXPECT_FALSE(result); |
| 142 } | 142 } |
| OLD | NEW |