From cbc0e1b7a534df83db009edef7843d029f307ff9 Mon Sep 17 00:00:00 2001 From: "phajdan.jr@chromium.org" Date: Mon, 12 Apr 2010 18:33:04 +0000 Subject: [GTTF] Make automation calls for Downloads, Extensions, and History pages reliable. This way we'll be able to write good pyauto tests for them. TEST=ui_tests BUG=none Review URL: http://codereview.chromium.org/1562021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@44264 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/test/automation/automation_proxy_uitest.cc | 31 +++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'chrome/test/automation/automation_proxy_uitest.cc') diff --git a/chrome/test/automation/automation_proxy_uitest.cc b/chrome/test/automation/automation_proxy_uitest.cc index b3dce0f..9850d1f 100644 --- a/chrome/test/automation/automation_proxy_uitest.cc +++ b/chrome/test/automation/automation_proxy_uitest.cc @@ -435,6 +435,7 @@ TEST_F(AutomationProxyTest, NavigateToURLAsync) { TEST_F(AutomationProxyTest, AcceleratorNewTab) { scoped_refptr window(automation()->GetBrowserWindow(0)); + ASSERT_TRUE(window.get()); int tab_count = -1; ASSERT_TRUE(window->RunCommand(IDC_NEW_TAB)); @@ -445,6 +446,36 @@ TEST_F(AutomationProxyTest, AcceleratorNewTab) { ASSERT_TRUE(tab.get()); } +TEST_F(AutomationProxyTest, AcceleratorDownloads) { + scoped_refptr window(automation()->GetBrowserWindow(0)); + ASSERT_TRUE(window.get()); + + ASSERT_TRUE(window->RunCommand(IDC_SHOW_DOWNLOADS)); + + // We expect the RunCommand above to wait until the title is updated. + EXPECT_EQ(L"Downloads", GetActiveTabTitle()); +} + +TEST_F(AutomationProxyTest, AcceleratorExtensions) { + scoped_refptr window(automation()->GetBrowserWindow(0)); + ASSERT_TRUE(window.get()); + + ASSERT_TRUE(window->RunCommand(IDC_MANAGE_EXTENSIONS)); + + // We expect the RunCommand above to wait until the title is updated. + EXPECT_EQ(L"Extensions", GetActiveTabTitle()); +} + +TEST_F(AutomationProxyTest, AcceleratorHistory) { + scoped_refptr window(automation()->GetBrowserWindow(0)); + ASSERT_TRUE(window.get()); + + ASSERT_TRUE(window->RunCommand(IDC_SHOW_HISTORY)); + + // We expect the RunCommand above to wait until the title is updated. + EXPECT_EQ(L"History", GetActiveTabTitle()); +} + class AutomationProxyTest4 : public UITest { protected: AutomationProxyTest4() : UITest() { -- cgit v1.1