Chromium Code Reviews| Index: chrome/browser/history/history_browsertest.cc |
| diff --git a/chrome/browser/history/history_browsertest.cc b/chrome/browser/history/history_browsertest.cc |
| index be46bc3d3e3939f3540d3c6c84bc9099515b1992..38964feac58d5040f83db6a1db099e503464388b 100644 |
| --- a/chrome/browser/history/history_browsertest.cc |
| +++ b/chrome/browser/history/history_browsertest.cc |
| @@ -22,6 +22,7 @@ |
| #include "chrome/common/url_constants.h" |
| #include "chrome/test/base/in_process_browser_test.h" |
| #include "chrome/test/base/ui_test_utils.h" |
| +#include "content/public/browser/notification_service.h" |
| #include "content/public/browser/web_contents.h" |
| #include "content/public/test/browser_test_utils.h" |
| #include "content/public/test/test_browser_thread.h" |
| @@ -62,6 +63,15 @@ class WaitForHistoryTask : public history::HistoryDBTask { |
| class HistoryBrowserTest : public InProcessBrowserTest { |
| protected: |
| + virtual void SetUpOnMainThread() OVERRIDE { |
| + InProcessBrowserTest::SetUpOnMainThread(); |
| + // Wait for the InstantNTP prerendered contents to load. |
| + content::WindowedNotificationObserver observer( |
|
sky
2013/10/07 20:30:59
Why do some tests need to do this?
samarth
2013/10/11 22:26:04
It's because the prerendering of the Instant NTP c
|
| + content::NOTIFICATION_LOAD_STOP, |
| + content::NotificationService::AllSources()); |
| + observer.Wait(); |
| + } |
| + |
| virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { |
| command_line->AppendSwitch(switches::kEnableFileCookies); |
| } |
| @@ -311,7 +321,9 @@ IN_PROC_BROWSER_TEST_F(HistoryBrowserTest, InvalidURLNoHistory) { |
| // New tab page should not show up in history. |
| IN_PROC_BROWSER_TEST_F(HistoryBrowserTest, NewTabNoHistory) { |
| - ui_test_utils::NavigateToURL(browser(), GURL(chrome::kChromeUINewTabURL)); |
| + ui_test_utils::NavigateToURLWithDisposition( |
| + browser(), GURL(chrome::kChromeUINewTabURL), CURRENT_TAB, |
| + ui_test_utils::BROWSER_TEST_NONE); |
| ExpectEmptyHistory(); |
| } |