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