| Index: chrome/browser/ui/webui/ntp/new_tab_ui_uitest.cc
|
| diff --git a/chrome/browser/ui/webui/ntp/new_tab_ui_uitest.cc b/chrome/browser/ui/webui/ntp/new_tab_ui_uitest.cc
|
| index 30447db4acfe67da1e3d93e0a8444e699749d632..b7b32d29bf738079af562fd2fd56e14df3a00749 100644
|
| --- a/chrome/browser/ui/webui/ntp/new_tab_ui_uitest.cc
|
| +++ b/chrome/browser/ui/webui/ntp/new_tab_ui_uitest.cc
|
| @@ -4,101 +4,30 @@
|
|
|
| #include "chrome/test/ui/ui_test.h"
|
|
|
| +#include "base/memory/ref_counted.h"
|
| #include "base/test/test_timeouts.h"
|
| #include "chrome/app/chrome_command_ids.h"
|
| -#include "chrome/browser/prefs/pref_value_store.h"
|
| -#include "chrome/browser/signin/signin_manager.h"
|
| #include "chrome/browser/ui/webui/ntp/new_tab_ui.h"
|
| #include "chrome/common/chrome_switches.h"
|
| -#include "chrome/common/json_pref_store.h"
|
| #include "chrome/common/pref_names.h"
|
| #include "chrome/common/url_constants.h"
|
| #include "chrome/test/automation/automation_proxy.h"
|
| #include "chrome/test/automation/browser_proxy.h"
|
| #include "chrome/test/automation/tab_proxy.h"
|
| -#include "chrome/test/automation/window_proxy.h"
|
| -#include "chrome/test/base/testing_pref_service.h"
|
| +#include "googleurl/src/gurl.h"
|
|
|
| class NewTabUITest : public UITest {
|
| public:
|
| NewTabUITest() {
|
| dom_automation_enabled_ = true;
|
| - // Set home page to the empty string so that we can set the home page using
|
| - // preferences.
|
| - set_homepage("");
|
| -
|
| // Setup the DEFAULT_THEME profile (has fake history entries).
|
| set_template_user_data(UITest::ComputeTypicalUserDataSource(
|
| UITestBase::DEFAULT_THEME));
|
| }
|
| };
|
|
|
| -#if defined(OS_WIN)
|
| -// Bug 87200: Disable NTPHasThumbnails for Windows
|
| -#define MAYBE_NTPHasThumbnails DISABLED_NTPHasThumbnails
|
| -#elif defined(OS_LINUX)
|
| -// This test is flaky on Linux and CrOS: http://crbug/30367
|
| -#define MAYBE_NTPHasThumbnails DISABLED_NTPHasThumbnails
|
| -#elif defined(OS_MACOSX)
|
| -// Acting flaky on Mac: http://crbug.com/87200
|
| -#define MAYBE_NTPHasThumbnails DISABLED_NTPHasThumbnails
|
| -#else
|
| -#define MAYBE_NTPHasThumbnails NTPHasThumbnails
|
| -#endif
|
| -TEST_F(NewTabUITest, MAYBE_NTPHasThumbnails) {
|
| - // Switch to the "new tab" tab, which should be any new tab after the
|
| - // first (the first is about:blank).
|
| - scoped_refptr<BrowserProxy> window(automation()->GetBrowserWindow(0));
|
| - ASSERT_TRUE(window.get());
|
| -
|
| - // Bring up a new tab page.
|
| - ASSERT_TRUE(window->RunCommand(IDC_NEW_TAB));
|
| -
|
| - scoped_refptr<TabProxy> tab = window->GetActiveTab();
|
| - ASSERT_TRUE(tab.get());
|
| -
|
| - // TopSites should return at least 3 non-filler pages.
|
| - // 8 - 3 = max 5 filler pages.
|
| - ASSERT_TRUE(WaitUntilJavaScriptCondition(tab, L"",
|
| - L"window.domAutomationController.send("
|
| - L"document.getElementsByClassName('filler').length <= 5)",
|
| - TestTimeouts::action_max_timeout_ms()));
|
| -}
|
| -
|
| -// Sometimes hangs: http://crbug.com/70157
|
| -TEST_F(NewTabUITest, DISABLED_NTPHasLoginName) {
|
| - scoped_refptr<BrowserProxy> window(automation()->GetBrowserWindow(0));
|
| - ASSERT_TRUE(window.get());
|
| -
|
| - ASSERT_TRUE(window->SetStringPreference(prefs::kGoogleServicesUsername,
|
| - "user@gmail.com"));
|
| - // Bring up a new tab page.
|
| - ASSERT_TRUE(window->RunCommand(IDC_NEW_TAB));
|
| -
|
| - scoped_refptr<TabProxy> tab = window->GetActiveTab();
|
| - ASSERT_TRUE(tab.get());
|
| -
|
| - std::wstring displayed_username;
|
| - // The login span should be eventually populated and have the
|
| - // correct value.
|
| - ASSERT_TRUE(WaitUntilJavaScriptCondition(tab, L"",
|
| - L"window.domAutomationController.send("
|
| - L"document.getElementById('login-username').innerText.length > 0)",
|
| - TestTimeouts::action_max_timeout_ms()));
|
| -
|
| - ASSERT_TRUE(tab->ExecuteAndExtractString(
|
| - L"",
|
| - L"window.domAutomationController.send("
|
| - L"document.getElementById('login-username').innerText)",
|
| - &displayed_username));
|
| -
|
| - EXPECT_EQ(L"user@gmail.com", displayed_username);
|
| -}
|
| -
|
| -// Bug 87200: Disable ChromeHangInNTP for Windows
|
| -#if defined(OS_WIN)
|
| -#define MAYBE_ChromeHangInNTP DISABLED_ChromeHangInNTP
|
| -#elif defined(OS_CHROMEOS)
|
| +// Bug 87200: Disable ChromeHangInNTP for Windows and ChromeOS
|
| +#if defined(OS_WIN) || defined(OS_CHROMEOS)
|
| #define MAYBE_ChromeHangInNTP DISABLED_ChromeHangInNTP
|
| #elif defined(OS_MACOSX)
|
| // Acting flaky on Mac: http://crbug.com/87200
|
|
|