OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <sstream> | 5 #include <sstream> |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/metrics/histogram_base.h" | 8 #include "base/metrics/histogram_base.h" |
9 #include "base/metrics/histogram_samples.h" | 9 #include "base/metrics/histogram_samples.h" |
10 #include "base/metrics/statistics_recorder.h" | 10 #include "base/metrics/statistics_recorder.h" |
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
423 content::NotificationService::AllSources()); | 423 content::NotificationService::AllSources()); |
424 SetOmniboxText(instant_url().Resolve("#q=puppies").spec()); | 424 SetOmniboxText(instant_url().Resolve("#q=puppies").spec()); |
425 PressEnterAndWaitForNavigation(); | 425 PressEnterAndWaitForNavigation(); |
426 observer_2.Wait(); | 426 observer_2.Wait(); |
427 | 427 |
428 // Should not have reused the tab. | 428 // Should not have reused the tab. |
429 active_tab = browser()->tab_strip_model()->GetActiveWebContents(); | 429 active_tab = browser()->tab_strip_model()->GetActiveWebContents(); |
430 ASSERT_THAT(active_tab->GetURL().spec(), HasSubstr("q=puppies")); | 430 ASSERT_THAT(active_tab->GetURL().spec(), HasSubstr("q=puppies")); |
431 } | 431 } |
432 | 432 |
433 IN_PROC_BROWSER_TEST_F(InstantExtendedTest, OmniboxMarginSetForSearchURLs) { | 433 #if defined(OS_LINUX) && defined(ADDRESS_SANITIZER) |
| 434 // Flaky crashes at shutdown on Linux Asan; http://crbug.com/517886. |
| 435 #define MAYBE_OmniboxMarginSetForSearchURLs \ |
| 436 DISABLED_OmniboxMarginSetForSearchURLs |
| 437 #else |
| 438 #define MAYBE_OmniboxMarginSetForSearchURLs OmniboxMarginSetForSearchURLs |
| 439 #endif |
| 440 IN_PROC_BROWSER_TEST_F(InstantExtendedTest, |
| 441 MAYBE_OmniboxMarginSetForSearchURLs) { |
434 ASSERT_NO_FATAL_FAILURE(SetupInstant(browser())); | 442 ASSERT_NO_FATAL_FAILURE(SetupInstant(browser())); |
435 FocusOmnibox(); | 443 FocusOmnibox(); |
436 | 444 |
437 // Create an observer to wait for the instant tab to support Instant. | 445 // Create an observer to wait for the instant tab to support Instant. |
438 content::WindowedNotificationObserver observer( | 446 content::WindowedNotificationObserver observer( |
439 chrome::NOTIFICATION_INSTANT_TAB_SUPPORT_DETERMINED, | 447 chrome::NOTIFICATION_INSTANT_TAB_SUPPORT_DETERMINED, |
440 content::NotificationService::AllSources()); | 448 content::NotificationService::AllSources()); |
441 | 449 |
442 SetOmniboxText("flowers"); | 450 SetOmniboxText("flowers"); |
443 browser()->window()->GetLocationBar()->AcceptInput(); | 451 browser()->window()->GetLocationBar()->AcceptInput(); |
(...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
974 stream << "link.href = \"" << result_url.spec() << "\";"; | 982 stream << "link.href = \"" << result_url.spec() << "\";"; |
975 stream << "document.body.appendChild(link);"; | 983 stream << "document.body.appendChild(link);"; |
976 stream << "link.click();"; | 984 stream << "link.click();"; |
977 EXPECT_TRUE(content::ExecuteScript(contents, stream.str())); | 985 EXPECT_TRUE(content::ExecuteScript(contents, stream.str())); |
978 | 986 |
979 content::WaitForLoadStop(contents); | 987 content::WaitForLoadStop(contents); |
980 std::string expected_title = | 988 std::string expected_title = |
981 "Referrer is " + instant_url().GetWithEmptyPath().spec(); | 989 "Referrer is " + instant_url().GetWithEmptyPath().spec(); |
982 EXPECT_EQ(ASCIIToUTF16(expected_title), contents->GetTitle()); | 990 EXPECT_EQ(ASCIIToUTF16(expected_title), contents->GetTitle()); |
983 } | 991 } |
OLD | NEW |