diff options
author | erikkay@chromium.org <erikkay@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-12 20:12:42 +0000 |
---|---|---|
committer | erikkay@chromium.org <erikkay@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-12 20:12:42 +0000 |
commit | 6d7a6046d581348565fc0634d81efce653a1f550 (patch) | |
tree | d7f2b7ca49c1805d11dea9751adea02a0562a939 /chrome/browser/extensions/extension_browsertests_misc.cc | |
parent | 0ba9330a17a3fd294a28972f5a81b64f550e6a20 (diff) | |
download | chromium_src-6d7a6046d581348565fc0634d81efce653a1f550.zip chromium_src-6d7a6046d581348565fc0634d81efce653a1f550.tar.gz chromium_src-6d7a6046d581348565fc0634d81efce653a1f550.tar.bz2 |
remove toolstrips
BUG=51703
BUG=30178
BUG=25106
TEST=none
Review URL: http://codereview.chromium.org/3129003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@55921 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/extension_browsertests_misc.cc')
-rw-r--r-- | chrome/browser/extensions/extension_browsertests_misc.cc | 107 |
1 files changed, 1 insertions, 106 deletions
diff --git a/chrome/browser/extensions/extension_browsertests_misc.cc b/chrome/browser/extensions/extension_browsertests_misc.cc index 8b7c9a2..038d07f 100644 --- a/chrome/browser/extensions/extension_browsertests_misc.cc +++ b/chrome/browser/extensions/extension_browsertests_misc.cc @@ -20,7 +20,6 @@ #include "chrome/browser/renderer_host/site_instance.h" #include "chrome/browser/tab_contents/tab_contents.h" #if defined(TOOLKIT_VIEWS) -#include "chrome/browser/views/extensions/extension_shelf.h" #include "chrome/browser/views/frame/browser_view.h" #endif #include "chrome/common/chrome_paths.h" @@ -73,110 +72,6 @@ static ExtensionHost* FindHostWithPath(ExtensionProcessManager* manager, return host; } -#if defined(OS_LINUX) && defined(TOOLKIT_VIEWS) -// See http://crbug.com/30151. -#define Toolstrip DISABLED_Toolstrip -#endif - -// Tests that toolstrips initializes properly and can run basic extension js. -IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, Toolstrip) { - FilePath extension_test_data_dir = test_data_dir_.AppendASCII("good"). - AppendASCII("Extensions").AppendASCII("behllobkkfkfnphdnhnkndlbkcpglgmj"). - AppendASCII("1.0.0.0"); - ASSERT_TRUE(LoadExtension(extension_test_data_dir)); - - // At this point, there should be three ExtensionHosts loaded because this - // extension has two toolstrips and one background page. Find the one that is - // hosting toolstrip1.html. - ExtensionProcessManager* manager = - browser()->profile()->GetExtensionProcessManager(); - ExtensionHost* host = FindHostWithPath(manager, "/toolstrip1.html", 3); - - // Tell it to run some JavaScript that tests that basic extension code works. - bool result = false; - ui_test_utils::ExecuteJavaScriptAndExtractBool( - host->render_view_host(), L"", L"testTabsAPI()", &result); - EXPECT_TRUE(result); - - // Test for compact language detection API. First navigate to a (static) html - // file with a French sentence. Then, run the test API in toolstrip1.html to - // actually call the language detection API through the existing extension, - // and verify that the language returned is indeed French. - FilePath language_url = extension_test_data_dir.AppendASCII( - "french_sentence.html"); - ui_test_utils::NavigateToURL(browser(), net::FilePathToFileURL(language_url)); - - ui_test_utils::ExecuteJavaScriptAndExtractBool( - host->render_view_host(), L"", L"testTabsLanguageAPI()", &result); - EXPECT_TRUE(result); -} - -IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, ExtensionViews) { - FilePath extension_test_data_dir = test_data_dir_.AppendASCII("good"). - AppendASCII("Extensions").AppendASCII("behllobkkfkfnphdnhnkndlbkcpglgmj"). - AppendASCII("1.0.0.0"); - ASSERT_TRUE(LoadExtension(extension_test_data_dir)); - - // At this point, there should be three ExtensionHosts loaded because this - // extension has two toolstrips and one background page. Find the one that is - // hosting toolstrip1.html. - ExtensionProcessManager* manager = - browser()->profile()->GetExtensionProcessManager(); - ExtensionHost* host = FindHostWithPath(manager, "/toolstrip1.html", 3); - - FilePath gettabs_url = extension_test_data_dir.AppendASCII( - "test_gettabs.html"); - ui_test_utils::NavigateToURL( - browser(), - GURL(gettabs_url.value())); - - bool result = false; - ui_test_utils::ExecuteJavaScriptAndExtractBool( - host->render_view_host(), L"", L"testgetToolstripsAPI()", &result); - EXPECT_TRUE(result); - - result = false; - ui_test_utils::ExecuteJavaScriptAndExtractBool( - host->render_view_host(), L"", L"testgetBackgroundPageAPI()", &result); - EXPECT_TRUE(result); - - ui_test_utils::NavigateToURL( - browser(), - GURL("chrome-extension://behllobkkfkfnphdnhnkndlbkcpglgmj/" - "test_gettabs.html")); - result = false; - ui_test_utils::ExecuteJavaScriptAndExtractBool( - host->render_view_host(), L"", L"testgetExtensionTabsAPI()", &result); - EXPECT_TRUE(result); -} - -#if defined(TOOLKIT_VIEWS) -// http://crbug.com/29897 - for other UI toolkits? - -// Tests that the ExtensionShelf initializes properly, notices that -// an extension loaded and has a view available, and then sets that up -// properly. -IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, Shelf) { - // When initialized, there are no extension views and the preferred height - // should be zero. - BrowserView* browser_view = static_cast<BrowserView*>(browser()->window()); - ExtensionShelf* shelf = browser_view->extension_shelf(); - ASSERT_TRUE(shelf); - EXPECT_EQ(shelf->GetChildViewCount(), 0); - EXPECT_EQ(shelf->GetPreferredSize().height(), 0); - - ASSERT_TRUE(LoadExtension( - test_data_dir_.AppendASCII("good").AppendASCII("Extensions") - .AppendASCII("behllobkkfkfnphdnhnkndlbkcpglgmj") - .AppendASCII("1.0.0.0"))); - - // There should now be two extension views and preferred height of the view - // should be non-zero. - EXPECT_EQ(shelf->GetChildViewCount(), 2); - EXPECT_NE(shelf->GetPreferredSize().height(), 0); -} -#endif // defined(TOOLKIT_VIEWS) - // Tests that extension resources can be loaded from origins which the // extension specifies in permissions but not from others. IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, OriginPrivileges) { @@ -700,7 +595,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, LastError) { // Get the ExtensionHost that is hosting our toolstrip page. ExtensionProcessManager* manager = browser()->profile()->GetExtensionProcessManager(); - ExtensionHost* host = FindHostWithPath(manager, "/toolstrip.html", 1); + ExtensionHost* host = FindHostWithPath(manager, "/bg.html", 1); bool result = false; ui_test_utils::ExecuteJavaScriptAndExtractBool( |