Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(196)

Side by Side Diff: chrome/browser/safe_browsing/safe_browsing_navigation_observer_unittest.cc

Issue 2726433004: Disable 4 unit tests that are failing with PlzNavigate and Site Isolation. (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "chrome/browser/safe_browsing/safe_browsing_navigation_observer.h"
nasko 2017/03/01 00:24:00 nit: Empty line after this include.
jam 2017/03/01 00:58:31 this was changed by git cl format, so if I change
nasko 2017/03/01 01:03:32 git cl format respects ordering within sets of hea
jam 2017/03/01 01:06:10 Done.
6 #include "base/command_line.h"
5 #include "base/test/histogram_tester.h" 7 #include "base/test/histogram_tester.h"
6 #include "chrome/browser/safe_browsing/safe_browsing_navigation_observer.h"
7 #include "chrome/browser/safe_browsing/safe_browsing_navigation_observer_manager .h" 8 #include "chrome/browser/safe_browsing/safe_browsing_navigation_observer_manager .h"
8 #include "chrome/browser/sessions/session_tab_helper.h" 9 #include "chrome/browser/sessions/session_tab_helper.h"
9 #include "chrome/browser/ui/tabs/tab_strip_model.h" 10 #include "chrome/browser/ui/tabs/tab_strip_model.h"
10 #include "chrome/test/base/browser_with_test_window_test.h" 11 #include "chrome/test/base/browser_with_test_window_test.h"
12 #include "content/public/common/browser_side_navigation_policy.h"
13 #include "content/public/common/content_switches.h"
11 #include "content/public/test/test_renderer_host.h" 14 #include "content/public/test/test_renderer_host.h"
12 #include "testing/gmock/include/gmock/gmock.h" 15 #include "testing/gmock/include/gmock/gmock.h"
13 #include "testing/gtest/include/gtest/gtest.h" 16 #include "testing/gtest/include/gtest/gtest.h"
14 #include "ui/base/window_open_disposition.h" 17 #include "ui/base/window_open_disposition.h"
15 18
16 namespace { 19 namespace {
17 20
18 const char kNavigationEventCleanUpHistogramName[] = 21 const char kNavigationEventCleanUpHistogramName[] =
19 "SafeBrowsing.NavigationObserver.NavigationEventCleanUpCount"; 22 "SafeBrowsing.NavigationObserver.NavigationEventCleanUpCount";
20 const char kIPAddressCleanUpHistogramName[] = 23 const char kIPAddressCleanUpHistogramName[] =
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 GURL("http://foo/1"), // destination_url 169 GURL("http://foo/1"), // destination_url
167 tab_id, // source_tab_id 170 tab_id, // source_tab_id
168 tab_id, // target_tab_id 171 tab_id, // target_tab_id
169 true, // is_user_initiated 172 true, // is_user_initiated
170 true, // has_committed 173 true, // has_committed
171 false, // has_server_redirect 174 false, // has_server_redirect
172 nav_list->Get(0U)); 175 nav_list->Get(0U));
173 } 176 }
174 177
175 TEST_F(SBNavigationObserverTest, ServerRedirect) { 178 TEST_F(SBNavigationObserverTest, ServerRedirect) {
179 if (content::IsBrowserSideNavigationEnabled() &&
180 base::CommandLine::ForCurrentProcess()->HasSwitch(
181 switches::kSitePerProcess)) {
182 // http://crbug.com/674734 Fix this test with PlzNavigate and Site Isolation
183 return;
184 }
176 content::RenderFrameHostTester* rfh_tester = 185 content::RenderFrameHostTester* rfh_tester =
177 content::RenderFrameHostTester::For( 186 content::RenderFrameHostTester::For(
178 browser()->tab_strip_model()->GetActiveWebContents()->GetMainFrame()); 187 browser()->tab_strip_model()->GetActiveWebContents()->GetMainFrame());
179 rfh_tester->SimulateNavigationStart(GURL("http://foo/3")); 188 rfh_tester->SimulateNavigationStart(GURL("http://foo/3"));
180 GURL redirect("http://redirect/1"); 189 GURL redirect("http://redirect/1");
181 rfh_tester->SimulateRedirect(redirect); 190 rfh_tester->SimulateRedirect(redirect);
182 rfh_tester->SimulateNavigationCommit(redirect); 191 rfh_tester->SimulateNavigationCommit(redirect);
183 int tab_id = SessionTabHelper::IdForTab( 192 int tab_id = SessionTabHelper::IdForTab(
184 browser()->tab_strip_model()->GetWebContentsAt(0)); 193 browser()->tab_strip_model()->GetWebContentsAt(0));
185 auto* nav_list = navigation_event_list(); 194 auto* nav_list = navigation_event_list();
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 // Record a host-ip pair, neither of which has been seen before. 342 // Record a host-ip pair, neither of which has been seen before.
334 std::string host_1 = GURL("http://bar/1").host(); 343 std::string host_1 = GURL("http://bar/1").host();
335 RecordHostToIpMapping(host_1, "9.9.9.9"); 344 RecordHostToIpMapping(host_1, "9.9.9.9");
336 ASSERT_EQ(2U, host_to_ip_map()->size()); 345 ASSERT_EQ(2U, host_to_ip_map()->size());
337 EXPECT_EQ(3U, host_to_ip_map()->at(host_0).size()); 346 EXPECT_EQ(3U, host_to_ip_map()->at(host_0).size());
338 EXPECT_EQ(1U, host_to_ip_map()->at(host_1).size()); 347 EXPECT_EQ(1U, host_to_ip_map()->at(host_1).size());
339 EXPECT_EQ("9.9.9.9", host_to_ip_map()->at(host_1).at(0).ip); 348 EXPECT_EQ("9.9.9.9", host_to_ip_map()->at(host_1).at(0).ip);
340 } 349 }
341 350
342 } // namespace safe_browsing 351 } // namespace safe_browsing
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698