diff options
author | finnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-19 13:07:45 +0000 |
---|---|---|
committer | finnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-19 13:07:45 +0000 |
commit | 3c202abd061f35e1655fe230b358d9fc46e00053 (patch) | |
tree | 9f181a22644b532da82b4acd68c1c2a1e90ace21 | |
parent | 977177d649da96eebe98fb46ed0a8e47acc64986 (diff) | |
download | chromium_src-3c202abd061f35e1655fe230b358d9fc46e00053.zip chromium_src-3c202abd061f35e1655fe230b358d9fc46e00053.tar.gz chromium_src-3c202abd061f35e1655fe230b358d9fc46e00053.tar.bz2 |
Enable one test for more debugging and remove debugging code from another test
that hasn't been problematic since it was enabled (crash was caused by an unrelated
problem that has now been fixed, apparently).
BUG=64304, 69882
TEST=None, just changing automated tests.
Review URL: http://codereview.chromium.org/6877007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@82100 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/extensions/all_urls_apitest.cc | 18 | ||||
-rw-r--r-- | chrome/browser/ui/views/find_bar_host_interactive_uitest.cc | 33 |
2 files changed, 31 insertions, 20 deletions
diff --git a/chrome/browser/extensions/all_urls_apitest.cc b/chrome/browser/extensions/all_urls_apitest.cc index 36a7750..e34e989 100644 --- a/chrome/browser/extensions/all_urls_apitest.cc +++ b/chrome/browser/extensions/all_urls_apitest.cc @@ -15,16 +15,6 @@ const std::string kAllUrlsTarget = typedef ExtensionApiTest AllUrlsApiTest; -namespace { - -void Checkpoint(const char* message, const base::TimeTicks& start_time) { - LOG(INFO) << message << " : " - << (base::TimeTicks::Now() - start_time).InMilliseconds() - << " ms" << std::flush; -} - -} // namespace - IN_PROC_BROWSER_TEST_F(AllUrlsApiTest, WhitelistedExtension) { // First setup the two extensions. FilePath extension_dir1 = test_data_dir_.AppendASCII("all_urls") @@ -93,16 +83,12 @@ IN_PROC_BROWSER_TEST_F(AllUrlsApiTest, WhitelistedExtension) { // Test that an extension NOT whitelisted for scripting can ask for <all_urls> // and run scripts on non-restricted all pages. IN_PROC_BROWSER_TEST_F(AllUrlsApiTest, RegularExtensions) { - base::TimeTicks start_time = base::TimeTicks::Now(); - Checkpoint("Test starting", start_time); - // First load the two extension. FilePath extension_dir1 = test_data_dir_.AppendASCII("all_urls") .AppendASCII("content_script"); FilePath extension_dir2 = test_data_dir_.AppendASCII("all_urls") .AppendASCII("execute_script"); - Checkpoint("Loading extensions", start_time); ExtensionService* service = browser()->profile()->GetExtensionService(); const size_t size_before = service->extensions()->size(); @@ -110,17 +96,13 @@ IN_PROC_BROWSER_TEST_F(AllUrlsApiTest, RegularExtensions) { ASSERT_TRUE(LoadExtension(extension_dir2)); EXPECT_EQ(size_before + 2, service->extensions()->size()); - Checkpoint("Starting server", start_time); - // Now verify we can script a regular http page. ASSERT_TRUE(test_server()->Start()); GURL page_url = test_server()->GetURL(kAllUrlsTarget); ExtensionTestMessageListener listener1a("content script: " + page_url.spec(), false); ExtensionTestMessageListener listener1b("execute: " + page_url.spec(), false); - Checkpoint("Navigate to URL", start_time); ui_test_utils::NavigateToURL(browser(), page_url); ASSERT_TRUE(listener1a.WaitUntilSatisfied()); ASSERT_TRUE(listener1b.WaitUntilSatisfied()); - Checkpoint("Test ending", start_time); } diff --git a/chrome/browser/ui/views/find_bar_host_interactive_uitest.cc b/chrome/browser/ui/views/find_bar_host_interactive_uitest.cc index 8b6ea35..5e3a915 100644 --- a/chrome/browser/ui/views/find_bar_host_interactive_uitest.cc +++ b/chrome/browser/ui/views/find_bar_host_interactive_uitest.cc @@ -25,6 +25,12 @@ namespace { static const int kActionDelayMs = 500; static const char kSimplePage[] = "files/find_in_page/simple.html"; +void Checkpoint(const char* message, const base::TimeTicks& start_time) { + LOG(INFO) << message << " : " + << (base::TimeTicks::Now() - start_time).InMilliseconds() + << " ms" << std::flush; +} + class FindInPageTest : public InProcessBrowserTest { public: FindInPageTest() { @@ -171,12 +177,13 @@ IN_PROC_BROWSER_TEST_F(FindInPageTest, FocusRestoreOnTabSwitch) { // This tests that whenever you clear values from the Find box and close it that // it respects that and doesn't show you the last search, as reported in bug: // http://crbug.com/40121. -// Crashy, http://crbug.com/69882. -IN_PROC_BROWSER_TEST_F(FindInPageTest, DISABLED_PrepopulateRespectBlank) { +IN_PROC_BROWSER_TEST_F(FindInPageTest, PrepopulateRespectBlank) { #if defined(OS_MACOSX) // FindInPage on Mac doesn't use prepopulated values. Search there is global. return; #endif + base::TimeTicks start_time = base::TimeTicks::Now(); + Checkpoint("Test starting", start_time); ASSERT_TRUE(test_server()->Start()); @@ -184,13 +191,19 @@ IN_PROC_BROWSER_TEST_F(FindInPageTest, DISABLED_PrepopulateRespectBlank) { // won't do anything and the test will hang. ASSERT_TRUE(ui_test_utils::BringBrowserWindowToFront(browser())); + Checkpoint("Navigate", start_time); + // First we navigate to any page. GURL url = test_server()->GetURL(kSimplePage); ui_test_utils::NavigateToURL(browser(), url); + Checkpoint("Show Find bar", start_time); + // Show the Find bar. browser()->GetFindBarController()->Show(); + Checkpoint("Search for 'a'", start_time); + // Search for "a". ASSERT_TRUE(ui_test_utils::SendKeyPressSync( browser(), ui::VKEY_A, false, false, false, false)); @@ -198,6 +211,8 @@ IN_PROC_BROWSER_TEST_F(FindInPageTest, DISABLED_PrepopulateRespectBlank) { // We should find "a" here. EXPECT_EQ(ASCIIToUTF16("a"), GetFindBarText()); + Checkpoint("Delete 'a'", start_time); + // Delete "a". ASSERT_TRUE(ui_test_utils::SendKeyPressSync( browser(), ui::VKEY_BACK, false, false, false, false)); @@ -205,26 +220,40 @@ IN_PROC_BROWSER_TEST_F(FindInPageTest, DISABLED_PrepopulateRespectBlank) { // Validate we have cleared the text. EXPECT_EQ(string16(), GetFindBarText()); + Checkpoint("Close find bar", start_time); + // Close the Find box. ASSERT_TRUE(ui_test_utils::SendKeyPressSync( browser(), ui::VKEY_ESCAPE, false, false, false, false)); + Checkpoint("Show Find bar", start_time); + // Show the Find bar. browser()->GetFindBarController()->Show(); + Checkpoint("Validate text", start_time); + // After the Find box has been reopened, it should not have been prepopulated // with "a" again. EXPECT_EQ(string16(), GetFindBarText()); + Checkpoint("Close Find bar", start_time); + // Close the Find box. ASSERT_TRUE(ui_test_utils::SendKeyPressSync( browser(), ui::VKEY_ESCAPE, false, false, false, false)); + Checkpoint("FindNext", start_time); + // Press F3 to trigger FindNext. ASSERT_TRUE(ui_test_utils::SendKeyPressSync( browser(), ui::VKEY_F3, false, false, false, false)); + Checkpoint("Validate", start_time); + // After the Find box has been reopened, it should still have no prepopulate // value. EXPECT_EQ(string16(), GetFindBarText()); + + Checkpoint("Test done", start_time); } |