| 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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 .AppendASCII("1.0.0.0"))); | 68 .AppendASCII("1.0.0.0"))); |
| 69 | 69 |
| 70 // There should now be two extension views and preferred height of the view | 70 // There should now be two extension views and preferred height of the view |
| 71 // should be non-zero. | 71 // should be non-zero. |
| 72 EXPECT_EQ(shelf->GetChildViewCount(), 2); | 72 EXPECT_EQ(shelf->GetChildViewCount(), 2); |
| 73 EXPECT_NE(shelf->GetPreferredSize().height(), 0); | 73 EXPECT_NE(shelf->GetPreferredSize().height(), 0); |
| 74 } | 74 } |
| 75 | 75 |
| 76 // Tests that installing and uninstalling extensions don't crash with an | 76 // Tests that installing and uninstalling extensions don't crash with an |
| 77 // incognito window open. | 77 // incognito window open. |
| 78 // This test is disabled. see bug 16106. |
| 79 #if 0 |
| 78 IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, Incognito) { | 80 IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, Incognito) { |
| 79 // Open an incognito window to the extensions management page. We just | 81 // Open an incognito window to the extensions management page. We just |
| 80 // want to make sure that we don't crash while playing with extensions when | 82 // want to make sure that we don't crash while playing with extensions when |
| 81 // this guy is around. | 83 // this guy is around. |
| 82 Browser::OpenURLOffTheRecord(browser()->profile(), | 84 Browser::OpenURLOffTheRecord(browser()->profile(), |
| 83 GURL(chrome::kChromeUIExtensionsURL)); | 85 GURL(chrome::kChromeUIExtensionsURL)); |
| 84 | 86 |
| 85 ASSERT_TRUE(InstallExtension(test_data_dir_.AppendASCII("good.crx"))); | 87 ASSERT_TRUE(InstallExtension(test_data_dir_.AppendASCII("good.crx"))); |
| 86 UninstallExtension("ldnnhddmnhbkjipkidpdiheffobcpfmf"); | 88 UninstallExtension("ldnnhddmnhbkjipkidpdiheffobcpfmf"); |
| 87 } | 89 } |
| 90 #endif |
| 88 | 91 |
| 89 // Tests that we can load extension pages into the tab area and they can call | 92 // Tests that we can load extension pages into the tab area and they can call |
| 90 // extension APIs. | 93 // extension APIs. |
| 91 IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, TabContents) { | 94 IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, TabContents) { |
| 92 ASSERT_TRUE(LoadExtension( | 95 ASSERT_TRUE(LoadExtension( |
| 93 test_data_dir_.AppendASCII("good").AppendASCII("Extensions") | 96 test_data_dir_.AppendASCII("good").AppendASCII("Extensions") |
| 94 .AppendASCII("behllobkkfkfnphdnhnkndlbkcpglgmj") | 97 .AppendASCII("behllobkkfkfnphdnhnkndlbkcpglgmj") |
| 95 .AppendASCII("1.0.0.0"))); | 98 .AppendASCII("1.0.0.0"))); |
| 96 | 99 |
| 97 ui_test_utils::NavigateToURL( | 100 ui_test_utils::NavigateToURL( |
| 98 browser(), | 101 browser(), |
| 99 GURL("chrome-extension://behllobkkfkfnphdnhnkndlbkcpglgmj/page.html")); | 102 GURL("chrome-extension://behllobkkfkfnphdnhnkndlbkcpglgmj/page.html")); |
| 100 | 103 |
| 101 bool result = false; | 104 bool result = false; |
| 102 ui_test_utils::ExecuteJavaScriptAndExtractBool( | 105 ui_test_utils::ExecuteJavaScriptAndExtractBool( |
| 103 browser()->GetSelectedTabContents()->render_view_host(), L"", | 106 browser()->GetSelectedTabContents()->render_view_host(), L"", |
| 104 L"testTabsAPI()", &result); | 107 L"testTabsAPI()", &result); |
| 105 EXPECT_TRUE(result); | 108 EXPECT_TRUE(result); |
| 106 } | 109 } |
| OLD | NEW |