OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "base/strings/stringprintf.h" | 5 #include "base/strings/stringprintf.h" |
6 #include "chrome/browser/chrome_notification_types.h" | 6 #include "chrome/browser/chrome_notification_types.h" |
7 #include "chrome/browser/download/download_prefs.h" | 7 #include "chrome/browser/download/download_prefs.h" |
8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
9 #include "chrome/browser/safe_browsing/download_protection_service.h" | 9 #include "chrome/browser/safe_browsing/download_protection_service.h" |
10 #include "chrome/browser/safe_browsing/safe_browsing_navigation_observer.h" | 10 #include "chrome/browser/safe_browsing/safe_browsing_navigation_observer.h" |
(...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
554 referrer_chain[1]); | 554 referrer_chain[1]); |
555 VerifyReferrerChainEntry(initial_url, // url | 555 VerifyReferrerChainEntry(initial_url, // url |
556 ReferrerChainEntry::LANDING_PAGE, // type | 556 ReferrerChainEntry::LANDING_PAGE, // type |
557 test_server_ip, // ip_address | 557 test_server_ip, // ip_address |
558 GURL(), // referrer_url | 558 GURL(), // referrer_url |
559 GURL(), // referrer_main_frame_url | 559 GURL(), // referrer_main_frame_url |
560 false, // is_retargeting | 560 false, // is_retargeting |
561 referrer_chain[2]); | 561 referrer_chain[2]); |
562 } | 562 } |
563 | 563 |
564 // https://crbug.com/667784: The test is flaky on Linux. | |
565 #if defined(OS_LINUX) | |
566 #define MAYBE_SingleMetaRefreshRedirectTargetBlank DISABLED_SingleMetaRefreshRed
irectTargetBlank | |
567 #else | |
568 #define MAYBE_SingleMetaRefreshRedirectTargetBlank SingleMetaRefreshRedirectTarg
etBlank | |
569 #endif | |
570 // Click on a link which navigates to a page then redirects to a download using | 564 // Click on a link which navigates to a page then redirects to a download using |
571 // META HTTP-EQUIV="refresh". First navigation happens in target blank. | 565 // META HTTP-EQUIV="refresh". First navigation happens in target blank. |
572 IN_PROC_BROWSER_TEST_F(SBNavigationObserverBrowserTest, | 566 IN_PROC_BROWSER_TEST_F(SBNavigationObserverBrowserTest, |
573 MAYBE_SingleMetaRefreshRedirectTargetBlank) { | 567 SingleMetaRefreshRedirectTargetBlank) { |
574 GURL initial_url = embedded_test_server()->GetURL(kSingleFrameTestURL); | 568 GURL initial_url = embedded_test_server()->GetURL(kSingleFrameTestURL); |
575 ClickTestLink("single_meta_refresh_redirect_target_blank", 2, initial_url); | 569 ClickTestLink("single_meta_refresh_redirect_target_blank", 2, initial_url); |
576 GURL redirect_url = embedded_test_server()->GetURL(kRedirectURL); | 570 GURL redirect_url = embedded_test_server()->GetURL(kRedirectURL); |
577 GURL download_url = embedded_test_server()->GetURL(kDownloadItemURL); | 571 GURL download_url = embedded_test_server()->GetURL(kDownloadItemURL); |
578 std::string test_server_ip(embedded_test_server()->host_port_pair().host()); | 572 std::string test_server_ip(embedded_test_server()->host_port_pair().host()); |
579 auto nav_map = navigation_map(); | 573 auto nav_map = navigation_map(); |
580 ASSERT_TRUE(nav_map); | 574 ASSERT_TRUE(nav_map); |
581 ASSERT_EQ(std::size_t(3), nav_map->size()); | 575 ASSERT_EQ(std::size_t(3), nav_map->size()); |
582 ASSERT_EQ(2U, nav_map->at(redirect_url).size()); | 576 ASSERT_EQ(2U, nav_map->at(redirect_url).size()); |
583 ASSERT_EQ(1U, nav_map->at(download_url).size()); | 577 ASSERT_EQ(1U, nav_map->at(download_url).size()); |
(...skipping 913 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1497 yesterday, embedded_test_server()->host_port_pair().host())); | 1491 yesterday, embedded_test_server()->host_port_pair().host())); |
1498 ASSERT_EQ(1U, ip_map->at(test_server_host).size()); | 1492 ASSERT_EQ(1U, ip_map->at(test_server_host).size()); |
1499 ClickTestLink("direct_download", 1, initial_url); | 1493 ClickTestLink("direct_download", 1, initial_url); |
1500 EXPECT_EQ(1U, ip_map->at(test_server_host).size()); | 1494 EXPECT_EQ(1U, ip_map->at(test_server_host).size()); |
1501 EXPECT_EQ(embedded_test_server()->host_port_pair().host(), | 1495 EXPECT_EQ(embedded_test_server()->host_port_pair().host(), |
1502 ip_map->at(test_server_host).back().ip); | 1496 ip_map->at(test_server_host).back().ip); |
1503 EXPECT_NE(yesterday, ip_map->at(test_server_host).front().timestamp); | 1497 EXPECT_NE(yesterday, ip_map->at(test_server_host).front().timestamp); |
1504 } | 1498 } |
1505 | 1499 |
1506 } // namespace safe_browsing | 1500 } // namespace safe_browsing |
OLD | NEW |