diff options
author | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-02 17:14:07 +0000 |
---|---|---|
committer | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-02 17:14:07 +0000 |
commit | 3aa0d4bdf0961a497c9a2429cbe3c9fdd9d6bf3c (patch) | |
tree | 71c1c3b08dc6fe7e92077ca0deea4cdd22888a6a | |
parent | 2758531ff10c3e0b1141fa34fc9bb18838079a4e (diff) | |
download | chromium_src-3aa0d4bdf0961a497c9a2429cbe3c9fdd9d6bf3c.zip chromium_src-3aa0d4bdf0961a497c9a2429cbe3c9fdd9d6bf3c.tar.gz chromium_src-3aa0d4bdf0961a497c9a2429cbe3c9fdd9d6bf3c.tar.bz2 |
Re-enable HistoryBrowserTest.SavingHistoryDisabled and SavingHistoryDisabledThenEnabled
Also add debugging code in case they are still unstable. However,
the logs seem to indicate a bot/launcher issue.
BUG=57994
TEST=browser_tests
Review URL: http://codereview.chromium.org/6246030
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@73465 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/history/history_browsertest.cc | 48 |
1 files changed, 30 insertions, 18 deletions
diff --git a/chrome/browser/history/history_browsertest.cc b/chrome/browser/history/history_browsertest.cc index 7075b16..d5dc39b 100644 --- a/chrome/browser/history/history_browsertest.cc +++ b/chrome/browser/history/history_browsertest.cc @@ -17,6 +17,14 @@ namespace { +// Helper to debug intermittent test hangs/timeouts. +// TODO(phajdan.jr): remove when http://crbug.com/57994 is fixed. +void Checkpoint(const char* message, const base::TimeTicks& start_time) { + LOG(INFO) << message << " : " + << (base::TimeTicks::Now() - start_time).InMilliseconds() + << " ms" << std::flush; +} + // Note: WaitableEvent is not used for synchronization between the main thread // and history backend thread because the history subsystem posts tasks back // to the main thread. Had we tried to Signal an event in such a task @@ -141,49 +149,50 @@ IN_PROC_BROWSER_TEST_F(HistoryBrowserTest, SavingHistoryEnabled) { } } -// Times out on Vista only. http://crbug.com/57994 -#if defined(OS_WIN) -#define MAYBE_SavingHistoryDisabled DISABLED_SavingHistoryDisabled -#else -#define MAYBE_SavingHistoryDisabled SavingHistoryDisabled -#endif - // Test that disabling saving browser history really works. -IN_PROC_BROWSER_TEST_F(HistoryBrowserTest, MAYBE_SavingHistoryDisabled) { +// TODO(phajdan.jr): remove debug code when http://crbug.com/57994 is fixed. +IN_PROC_BROWSER_TEST_F(HistoryBrowserTest, SavingHistoryDisabled) { + base::TimeTicks start_time = base::TimeTicks::Now(); + GetPrefs()->SetBoolean(prefs::kSavingBrowserHistoryDisabled, true); EXPECT_TRUE(GetProfile()->GetHistoryService(Profile::EXPLICIT_ACCESS)); EXPECT_FALSE(GetProfile()->GetHistoryService(Profile::IMPLICIT_ACCESS)); + Checkpoint("Before waiting for history to load", start_time); ui_test_utils::WaitForHistoryToLoad(browser()); + Checkpoint("After waiting for history to load", start_time); ExpectEmptyHistory(); + Checkpoint("After checking history", start_time); ui_test_utils::NavigateToURL(browser(), GetTestUrl()); + Checkpoint("After NavigateToURL", start_time); WaitForHistoryBackendToRun(); + Checkpoint("After waiting for history backend to run", start_time); ExpectEmptyHistory(); + Checkpoint("After second check", start_time); } -// Times out on Vista only. http://crbug.com/57994 -#if defined(OS_WIN) -#define MAYBE_SavingHistoryEnabledThenDisabled \ - DISABLED_SavingHistoryEnabledThenDisabled -#else -#define MAYBE_SavingHistoryEnabledThenDisabled SavingHistoryEnabledThenDisabled -#endif - // Test that changing the pref takes effect immediately // when the browser is running. -IN_PROC_BROWSER_TEST_F(HistoryBrowserTest, - MAYBE_SavingHistoryEnabledThenDisabled) { +// TODO(phajdan.jr): remove debug code when http://crbug.com/57994 is fixed. +IN_PROC_BROWSER_TEST_F(HistoryBrowserTest, SavingHistoryEnabledThenDisabled) { + base::TimeTicks start_time = base::TimeTicks::Now(); + EXPECT_FALSE(GetPrefs()->GetBoolean(prefs::kSavingBrowserHistoryDisabled)); + Checkpoint("Before waiting for history to load", start_time); ui_test_utils::WaitForHistoryToLoad(browser()); + Checkpoint("After waiting for history to load", start_time); ui_test_utils::NavigateToURL(browser(), GetTestUrl()); + Checkpoint("After first NavigateToURL", start_time); WaitForHistoryBackendToRun(); + Checkpoint("After waiting for history backend to run", start_time); { std::vector<GURL> urls(GetHistoryContents()); + Checkpoint("After first GetHistoryContents", start_time); ASSERT_EQ(1U, urls.size()); EXPECT_EQ(GetTestUrl().spec(), urls[0].spec()); } @@ -191,11 +200,14 @@ IN_PROC_BROWSER_TEST_F(HistoryBrowserTest, GetPrefs()->SetBoolean(prefs::kSavingBrowserHistoryDisabled, true); ui_test_utils::NavigateToURL(browser(), GetTestUrl()); + Checkpoint("After second NavigateToURL", start_time); WaitForHistoryBackendToRun(); + Checkpoint("After waiting for history backend to run (2nd time)", start_time); { // No additional entries should be present in the history. std::vector<GURL> urls(GetHistoryContents()); + Checkpoint("After second GetHistoryContents", start_time); ASSERT_EQ(1U, urls.size()); EXPECT_EQ(GetTestUrl().spec(), urls[0].spec()); } |