| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/ref_counted.h" | 5 #include "base/ref_counted.h" |
| 6 #include "chrome/browser/browser.h" | 6 #include "chrome/browser/browser.h" |
| 7 #include "chrome/browser/browser_list.h" | 7 #include "chrome/browser/browser_list.h" |
| 8 #include "chrome/browser/renderer_host/render_view_host.h" | 8 #include "chrome/browser/renderer_host/render_view_host.h" |
| 9 #include "chrome/browser/extensions/extension_browsertest.h" | 9 #include "chrome/browser/extensions/extension_browsertest.h" |
| 10 #include "chrome/browser/extensions/extension_host.h" | 10 #include "chrome/browser/extensions/extension_host.h" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 EXPECT_FALSE(host); | 43 EXPECT_FALSE(host); |
| 44 host = *iter; | 44 host = *iter; |
| 45 } | 45 } |
| 46 num_hosts++; | 46 num_hosts++; |
| 47 } | 47 } |
| 48 EXPECT_EQ(expected_hosts, num_hosts); | 48 EXPECT_EQ(expected_hosts, num_hosts); |
| 49 return host; | 49 return host; |
| 50 } | 50 } |
| 51 | 51 |
| 52 // Tests that toolstrips initializes properly and can run basic extension js. | 52 // Tests that toolstrips initializes properly and can run basic extension js. |
| 53 // Disabled, see bug 22135 | 53 IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, Toolstrip) { |
| 54 IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, DISABLED_Toolstrip) { | |
| 55 FilePath extension_test_data_dir = test_data_dir_.AppendASCII("good"). | 54 FilePath extension_test_data_dir = test_data_dir_.AppendASCII("good"). |
| 56 AppendASCII("Extensions").AppendASCII("behllobkkfkfnphdnhnkndlbkcpglgmj"). | 55 AppendASCII("Extensions").AppendASCII("behllobkkfkfnphdnhnkndlbkcpglgmj"). |
| 57 AppendASCII("1.0.0.0"); | 56 AppendASCII("1.0.0.0"); |
| 58 ASSERT_TRUE(LoadExtension(extension_test_data_dir)); | 57 ASSERT_TRUE(LoadExtension(extension_test_data_dir)); |
| 59 | 58 |
| 60 // At this point, there should be three ExtensionHosts loaded because this | 59 // At this point, there should be three ExtensionHosts loaded because this |
| 61 // extension has two toolstrips and one background page. Find the one that is | 60 // extension has two toolstrips and one background page. Find the one that is |
| 62 // hosting toolstrip1.html. | 61 // hosting toolstrip1.html. |
| 63 ExtensionProcessManager* manager = | 62 ExtensionProcessManager* manager = |
| 64 browser()->profile()->GetExtensionProcessManager(); | 63 browser()->profile()->GetExtensionProcessManager(); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 81 browser(), | 80 browser(), |
| 82 GURL(language_url.ToWStringHack())); | 81 GURL(language_url.ToWStringHack())); |
| 83 | 82 |
| 84 ui_test_utils::ExecuteJavaScriptAndExtractBool( | 83 ui_test_utils::ExecuteJavaScriptAndExtractBool( |
| 85 host->render_view_host(), L"", L"testTabsLanguageAPI()", &result); | 84 host->render_view_host(), L"", L"testTabsLanguageAPI()", &result); |
| 86 EXPECT_TRUE(result); | 85 EXPECT_TRUE(result); |
| 87 #endif | 86 #endif |
| 88 } | 87 } |
| 89 | 88 |
| 90 #if defined(OS_WIN) // TODO(port) -- enable | 89 #if defined(OS_WIN) // TODO(port) -- enable |
| 91 // Disabled, see bug 22135 | 90 IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, ExtensionViews) { |
| 92 IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, DIABLED_ExtensionViews) { | |
| 93 FilePath extension_test_data_dir = test_data_dir_.AppendASCII("good"). | 91 FilePath extension_test_data_dir = test_data_dir_.AppendASCII("good"). |
| 94 AppendASCII("Extensions").AppendASCII("behllobkkfkfnphdnhnkndlbkcpglgmj"). | 92 AppendASCII("Extensions").AppendASCII("behllobkkfkfnphdnhnkndlbkcpglgmj"). |
| 95 AppendASCII("1.0.0.0"); | 93 AppendASCII("1.0.0.0"); |
| 96 ASSERT_TRUE(LoadExtension(extension_test_data_dir)); | 94 ASSERT_TRUE(LoadExtension(extension_test_data_dir)); |
| 97 | 95 |
| 98 // At this point, there should be three ExtensionHosts loaded because this | 96 // At this point, there should be three ExtensionHosts loaded because this |
| 99 // extension has two toolstrips and one background page. Find the one that is | 97 // extension has two toolstrips and one background page. Find the one that is |
| 100 // hosting toolstrip1.html. | 98 // hosting toolstrip1.html. |
| 101 ExtensionProcessManager* manager = | 99 ExtensionProcessManager* manager = |
| 102 browser()->profile()->GetExtensionProcessManager(); | 100 browser()->profile()->GetExtensionProcessManager(); |
| (...skipping 519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 622 browser(), | 620 browser(), |
| 623 GURL("about:blank"), | 621 GURL("about:blank"), |
| 624 "chrome-extension://" kDefaultExtensionID "/newtab.html"); | 622 "chrome-extension://" kDefaultExtensionID "/newtab.html"); |
| 625 | 623 |
| 626 // Extension API should fail. | 624 // Extension API should fail. |
| 627 bool result = false; | 625 bool result = false; |
| 628 ui_test_utils::ExecuteJavaScriptAndExtractBool( | 626 ui_test_utils::ExecuteJavaScriptAndExtractBool( |
| 629 newtab->render_view_host(), L"", L"testExtensionApi()", &result); | 627 newtab->render_view_host(), L"", L"testExtensionApi()", &result); |
| 630 EXPECT_FALSE(result); | 628 EXPECT_FALSE(result); |
| 631 } | 629 } |
| OLD | NEW |