OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "base/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/metrics/field_trial.h" | 6 #include "base/metrics/field_trial.h" |
7 #include "base/metrics/histogram_base.h" | 7 #include "base/metrics/histogram_base.h" |
8 #include "base/metrics/histogram_samples.h" | 8 #include "base/metrics/histogram_samples.h" |
9 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
246 contents->GetRenderProcessHost(); | 246 contents->GetRenderProcessHost(); |
247 const content::RenderViewHost* start_rvh = | 247 const content::RenderViewHost* start_rvh = |
248 contents->GetRenderViewHost(); | 248 contents->GetRenderViewHost(); |
249 | 249 |
250 // Navigate to end URL. | 250 // Navigate to end URL. |
251 NavigateAndCommitActiveTab(GURL(test.end_url)); | 251 NavigateAndCommitActiveTab(GURL(test.end_url)); |
252 EXPECT_EQ(test.end_in_instant_process, InInstantProcess(contents)) | 252 EXPECT_EQ(test.end_in_instant_process, InInstantProcess(contents)) |
253 << test.description; | 253 << test.description; |
254 | 254 |
255 EXPECT_EQ(test.same_site_instance, | 255 EXPECT_EQ(test.same_site_instance, |
256 start_site_instance == contents->GetSiteInstance()) | 256 start_site_instance.get() == contents->GetSiteInstance()) |
257 << test.description; | 257 << test.description; |
258 EXPECT_EQ(test.same_site_instance, | 258 EXPECT_EQ(test.same_site_instance, |
259 start_rvh == contents->GetRenderViewHost()) | 259 start_rvh == contents->GetRenderViewHost()) |
260 << test.description; | 260 << test.description; |
261 EXPECT_EQ(test.same_site_instance, | 261 EXPECT_EQ(test.same_site_instance, |
262 start_rph == contents->GetRenderProcessHost()) | 262 start_rph == contents->GetRenderProcessHost()) |
263 << test.description; | 263 << test.description; |
264 } | 264 } |
265 } | 265 } |
266 | 266 |
(...skipping 25 matching lines...) Expand all Loading... |
292 GURL(test.end_url)); | 292 GURL(test.end_url)); |
293 load_params.is_renderer_initiated = true; | 293 load_params.is_renderer_initiated = true; |
294 load_params.transition_type = content::PAGE_TRANSITION_LINK; | 294 load_params.transition_type = content::PAGE_TRANSITION_LINK; |
295 | 295 |
296 controller->LoadURLWithParams(load_params); | 296 controller->LoadURLWithParams(load_params); |
297 CommitPendingLoad(controller); | 297 CommitPendingLoad(controller); |
298 EXPECT_EQ(test.end_in_instant_process, InInstantProcess(contents)) | 298 EXPECT_EQ(test.end_in_instant_process, InInstantProcess(contents)) |
299 << test.description; | 299 << test.description; |
300 | 300 |
301 EXPECT_EQ(test.same_site_instance, | 301 EXPECT_EQ(test.same_site_instance, |
302 start_site_instance == contents->GetSiteInstance()) | 302 start_site_instance.get() == contents->GetSiteInstance()) |
303 << test.description; | 303 << test.description; |
304 EXPECT_EQ(test.same_site_instance, | 304 EXPECT_EQ(test.same_site_instance, |
305 start_rvh == contents->GetRenderViewHost()) | 305 start_rvh == contents->GetRenderViewHost()) |
306 << test.description; | 306 << test.description; |
307 EXPECT_EQ(test.same_site_instance, | 307 EXPECT_EQ(test.same_site_instance, |
308 start_rph == contents->GetRenderProcessHost()) | 308 start_rph == contents->GetRenderProcessHost()) |
309 << test.description; | 309 << test.description; |
310 } | 310 } |
311 } | 311 } |
312 | 312 |
(...skipping 687 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1000 } | 1000 } |
1001 | 1001 |
1002 TEST_F(OriginChipTest, CommandLineOnSrp) { | 1002 TEST_F(OriginChipTest, CommandLineOnSrp) { |
1003 CommandLine::ForCurrentProcess()->AppendSwitch( | 1003 CommandLine::ForCurrentProcess()->AppendSwitch( |
1004 switches::kEnableOriginChipOnSrp); | 1004 switches::kEnableOriginChipOnSrp); |
1005 EXPECT_TRUE(ShouldDisplayOriginChip()); | 1005 EXPECT_TRUE(ShouldDisplayOriginChip()); |
1006 EXPECT_EQ(ORIGIN_CHIP_ON_SRP, GetOriginChipCondition()); | 1006 EXPECT_EQ(ORIGIN_CHIP_ON_SRP, GetOriginChipCondition()); |
1007 } | 1007 } |
1008 | 1008 |
1009 } // namespace chrome | 1009 } // namespace chrome |
OLD | NEW |