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/extensions/extension_browsertest.h" | 5 #include "chrome/browser/extensions/extension_browsertest.h" |
6 #include "chrome/browser/extensions/extension_service.h" | 6 #include "chrome/browser/extensions/extension_service.h" |
7 #include "chrome/browser/extensions/extension_system.h" | 7 #include "chrome/browser/extensions/extension_system.h" |
8 #include "chrome/browser/ui/browser.h" | 8 #include "chrome/browser/ui/browser.h" |
9 #include "chrome/browser/ui/browser_tabstrip.h" | 9 #include "chrome/browser/ui/browser_tabstrip.h" |
10 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 10 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
(...skipping 22 matching lines...) Expand all Loading... |
33 const Extension* extension = | 33 const Extension* extension = |
34 InstallExtension(test_data_dir_.AppendASCII("options.crx"), 1); | 34 InstallExtension(test_data_dir_.AppendASCII("options.crx"), 1); |
35 ASSERT_TRUE(extension); | 35 ASSERT_TRUE(extension); |
36 ExtensionService* service = extensions::ExtensionSystem::Get( | 36 ExtensionService* service = extensions::ExtensionSystem::Get( |
37 browser()->profile())->extension_service(); | 37 browser()->profile())->extension_service(); |
38 ASSERT_EQ(1u, service->extensions()->size()); | 38 ASSERT_EQ(1u, service->extensions()->size()); |
39 | 39 |
40 // Go to the Extension Settings page and click the Options button. | 40 // Go to the Extension Settings page and click the Options button. |
41 ui_test_utils::NavigateToURL(browser(), GURL(chrome::kChromeUIExtensionsURL)); | 41 ui_test_utils::NavigateToURL(browser(), GURL(chrome::kChromeUIExtensionsURL)); |
42 TabStripModel* tab_strip = browser()->tab_strip_model(); | 42 TabStripModel* tab_strip = browser()->tab_strip_model(); |
43 ASSERT_TRUE(content::ExecuteJavaScript( | 43 ASSERT_TRUE(content::ExecuteScript(tab_strip->GetActiveWebContents(), |
44 tab_strip->GetActiveWebContents()->GetRenderViewHost(), | 44 kScriptClickOptionButton)); |
45 "", | |
46 kScriptClickOptionButton)); | |
47 | 45 |
48 // If the options page hasn't already come up, wait for it. | 46 // If the options page hasn't already come up, wait for it. |
49 if (tab_strip->count() == 1) { | 47 if (tab_strip->count() == 1) { |
50 ui_test_utils::WaitForNewTab(browser()); | 48 ui_test_utils::WaitForNewTab(browser()); |
51 } | 49 } |
52 ASSERT_EQ(2, tab_strip->count()); | 50 ASSERT_EQ(2, tab_strip->count()); |
53 | 51 |
54 EXPECT_EQ(extension->GetResourceURL("options.html"), | 52 EXPECT_EQ(extension->GetResourceURL("options.html"), |
55 tab_strip->GetWebContentsAt(1)->GetURL()); | 53 tab_strip->GetWebContentsAt(1)->GetURL()); |
56 } | 54 } |
OLD | NEW |