| Index: chrome/browser/dom_ui/new_tab_ui_uitest.cc
|
| ===================================================================
|
| --- chrome/browser/dom_ui/new_tab_ui_uitest.cc (revision 53632)
|
| +++ chrome/browser/dom_ui/new_tab_ui_uitest.cc (working copy)
|
| @@ -95,70 +95,3 @@
|
| migrated = NewTabUI::UpdateUserPrefsVersion(prefs.get());
|
| ASSERT_FALSE(migrated);
|
| }
|
| -
|
| -TEST_F(NewTabUITest, HomePageLink) {
|
| - scoped_refptr<BrowserProxy> browser(automation()->GetBrowserWindow(0));
|
| - ASSERT_TRUE(browser.get());
|
| -
|
| - ASSERT_TRUE(
|
| - browser->SetBooleanPreference(prefs::kHomePageIsNewTabPage, false));
|
| -
|
| - // Bring up a new tab page.
|
| - ASSERT_TRUE(browser->RunCommand(IDC_NEW_TAB));
|
| - int load_time;
|
| - ASSERT_TRUE(automation()->WaitForInitialNewTabUILoad(&load_time));
|
| -
|
| - scoped_refptr<TabProxy> tab = browser->GetActiveTab();
|
| - ASSERT_TRUE(tab.get());
|
| -
|
| - // TODO(arv): Extract common patterns for doing js testing.
|
| -
|
| - // Fire click. Because tip service is turned off for testing, we first
|
| - // force the "make this my home page" tip to appear.
|
| - // TODO(arv): Find screen position of element and use a lower level click
|
| - // emulation.
|
| - bool result;
|
| - ASSERT_TRUE(tab->ExecuteAndExtractBool(L"",
|
| - L"window.domAutomationController.send("
|
| - L"(function() {"
|
| - L" tipCache = [{\"set_homepage_tip\":\"Make this the home page\"}];"
|
| - L" renderTip();"
|
| - L" var e = document.createEvent('Event');"
|
| - L" e.initEvent('click', true, true);"
|
| - L" var el = document.querySelector('#tip-line > button');"
|
| - L" el.dispatchEvent(e);"
|
| - L" return true;"
|
| - L"})()"
|
| - L")",
|
| - &result));
|
| - ASSERT_TRUE(result);
|
| -
|
| - // Make sure text of "set as home page" tip has been removed.
|
| - std::wstring tip_text_content;
|
| - ASSERT_TRUE(tab->ExecuteAndExtractString(L"",
|
| - L"window.domAutomationController.send("
|
| - L"(function() {"
|
| - L" var el = document.querySelector('#tip-line');"
|
| - L" return el.textContent;"
|
| - L"})()"
|
| - L")",
|
| - &tip_text_content));
|
| - ASSERT_EQ(L"", tip_text_content);
|
| -
|
| - // Make sure that the notification is visible
|
| - bool has_class;
|
| - ASSERT_TRUE(tab->ExecuteAndExtractBool(L"",
|
| - L"window.domAutomationController.send("
|
| - L"(function() {"
|
| - L" var el = document.querySelector('#notification');"
|
| - L" return el.classList.contains('show');"
|
| - L"})()"
|
| - L")",
|
| - &has_class));
|
| - ASSERT_TRUE(has_class);
|
| -
|
| - bool is_home_page;
|
| - ASSERT_TRUE(browser->GetBooleanPreference(prefs::kHomePageIsNewTabPage,
|
| - &is_home_page));
|
| - ASSERT_TRUE(is_home_page);
|
| -}
|
|
|