Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(221)

Unified Diff: chrome/browser/extensions/extension_uitest.cc

Issue 366025: Modifying extension automation so that it is done through a particular... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/automation/automation_provider_win.cc ('k') | chrome/browser/external_tab_container.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_uitest.cc
===================================================================
--- chrome/browser/extensions/extension_uitest.cc (revision 31172)
+++ chrome/browser/extensions/extension_uitest.cc (working copy)
@@ -55,38 +55,46 @@
void SetUp() {
ParentTestType::SetUp();
- automation()->SetEnableExtensionAutomation(functions_enabled_);
+
+ AutomationProxyForExternalTab* proxy =
+ static_cast<AutomationProxyForExternalTab*>(automation());
+ HWND external_tab_container = NULL;
+ HWND tab_wnd = NULL;
+ tab_ = proxy->CreateTabWithHostWindow(false,
+ GURL(), &external_tab_container, &tab_wnd);
+
+ tab_->SetEnableExtensionAutomation(functions_enabled_);
}
void TearDown() {
- automation()->SetEnableExtensionAutomation(std::vector<std::string>());
+ tab_->SetEnableExtensionAutomation(std::vector<std::string>());
+
+ AutomationProxyForExternalTab* proxy =
+ static_cast<AutomationProxyForExternalTab*>(automation());
+ proxy->DestroyHostWindow();
+ proxy->WaitForTabCleanup(tab_, action_max_timeout_ms());
+ EXPECT_FALSE(tab_->is_valid());
+ tab_.release();
+
ParentTestType::TearDown();
}
void TestWithURL(const GURL& url) {
- AutomationProxyForExternalTab* proxy =
+ EXPECT_TRUE(tab_->is_valid());
+ if (tab_) {
+ AutomationProxyForExternalTab* proxy =
static_cast<AutomationProxyForExternalTab*>(automation());
- HWND external_tab_container = NULL;
- HWND tab_wnd = NULL;
- scoped_refptr<TabProxy> tab(proxy->CreateTabWithHostWindow(false,
- GURL(), &external_tab_container, &tab_wnd));
- EXPECT_TRUE(tab->is_valid());
- if (tab) {
// Enter a message loop to allow the tab to be created
proxy->WaitForNavigation(2000);
- DoAdditionalPreNavigateSetup(tab.get());
+ DoAdditionalPreNavigateSetup(tab_.get());
// We explicitly do not make this a toolstrip in the extension manifest,
// so that the test can control when it gets loaded, and so that we test
// the intended behavior that tabs should be able to show extension pages
// (useful for development etc.)
- tab->NavigateInExternalTab(url, GURL());
+ tab_->NavigateInExternalTab(url, GURL());
EXPECT_TRUE(proxy->WaitForMessage(action_max_timeout_ms()));
-
- proxy->DestroyHostWindow();
- proxy->WaitForTabCleanup(tab, action_max_timeout_ms());
- EXPECT_FALSE(tab->is_valid());
}
}
@@ -97,6 +105,7 @@
protected:
// Extension API functions that we want to take over. Defaults to all.
std::vector<std::string> functions_enabled_;
+ scoped_refptr<TabProxy> tab_;
private:
DISALLOW_COPY_AND_ASSIGN(ExtensionUITest);
« no previous file with comments | « chrome/browser/automation/automation_provider_win.cc ('k') | chrome/browser/external_tab_container.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698