| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <stdint.h> | 5 #include <stdint.h> |
| 6 #include <utility> | 6 #include <utility> |
| 7 | 7 |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 3288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3299 TestRenderFrameHost* rfh = main_test_rfh(); | 3299 TestRenderFrameHost* rfh = main_test_rfh(); |
| 3300 rfh->InitializeRenderFrameIfNeeded(); | 3300 rfh->InitializeRenderFrameIfNeeded(); |
| 3301 | 3301 |
| 3302 SkColor transparent = SK_ColorTRANSPARENT; | 3302 SkColor transparent = SK_ColorTRANSPARENT; |
| 3303 | 3303 |
| 3304 EXPECT_EQ(transparent, contents()->GetThemeColor()); | 3304 EXPECT_EQ(transparent, contents()->GetThemeColor()); |
| 3305 EXPECT_EQ(transparent, observer.last_theme_color()); | 3305 EXPECT_EQ(transparent, observer.last_theme_color()); |
| 3306 | 3306 |
| 3307 // Theme color changes should not propagate past the WebContentsImpl before | 3307 // Theme color changes should not propagate past the WebContentsImpl before |
| 3308 // the first visually non-empty paint has occurred. | 3308 // the first visually non-empty paint has occurred. |
| 3309 RenderViewHostTester::TestOnMessageReceived( | 3309 rfh->OnMessageReceived( |
| 3310 test_rvh(), | |
| 3311 FrameHostMsg_DidChangeThemeColor(rfh->GetRoutingID(), SK_ColorRED)); | 3310 FrameHostMsg_DidChangeThemeColor(rfh->GetRoutingID(), SK_ColorRED)); |
| 3312 | 3311 |
| 3313 EXPECT_EQ(SK_ColorRED, contents()->GetThemeColor()); | 3312 EXPECT_EQ(SK_ColorRED, contents()->GetThemeColor()); |
| 3314 EXPECT_EQ(transparent, observer.last_theme_color()); | 3313 EXPECT_EQ(transparent, observer.last_theme_color()); |
| 3315 | 3314 |
| 3316 // Simulate that the first visually non-empty paint has occurred. This will | 3315 // Simulate that the first visually non-empty paint has occurred. This will |
| 3317 // propagate the current theme color to the delegates. | 3316 // propagate the current theme color to the delegates. |
| 3318 RenderViewHostTester::TestOnMessageReceived( | 3317 RenderViewHostTester::TestOnMessageReceived( |
| 3319 test_rvh(), | 3318 test_rvh(), |
| 3320 ViewHostMsg_DidFirstVisuallyNonEmptyPaint(rfh->GetRoutingID())); | 3319 ViewHostMsg_DidFirstVisuallyNonEmptyPaint(test_rvh()->GetRoutingID())); |
| 3321 | 3320 |
| 3322 EXPECT_EQ(SK_ColorRED, contents()->GetThemeColor()); | 3321 EXPECT_EQ(SK_ColorRED, contents()->GetThemeColor()); |
| 3323 EXPECT_EQ(SK_ColorRED, observer.last_theme_color()); | 3322 EXPECT_EQ(SK_ColorRED, observer.last_theme_color()); |
| 3324 | 3323 |
| 3325 // Additional changes made by the web contents should propagate as well. | 3324 // Additional changes made by the web contents should propagate as well. |
| 3326 RenderViewHostTester::TestOnMessageReceived( | 3325 rfh->OnMessageReceived( |
| 3327 test_rvh(), | |
| 3328 FrameHostMsg_DidChangeThemeColor(rfh->GetRoutingID(), SK_ColorGREEN)); | 3326 FrameHostMsg_DidChangeThemeColor(rfh->GetRoutingID(), SK_ColorGREEN)); |
| 3329 | 3327 |
| 3330 EXPECT_EQ(SK_ColorGREEN, contents()->GetThemeColor()); | 3328 EXPECT_EQ(SK_ColorGREEN, contents()->GetThemeColor()); |
| 3331 EXPECT_EQ(SK_ColorGREEN, observer.last_theme_color()); | 3329 EXPECT_EQ(SK_ColorGREEN, observer.last_theme_color()); |
| 3332 } | 3330 } |
| 3333 | 3331 |
| 3334 // Test that if a resource is loaded with empty security info, the SSLManager | 3332 // Test that if a resource is loaded with empty security info, the SSLManager |
| 3335 // does not mistakenly think it has seen a good certificate and thus forget any | 3333 // does not mistakenly think it has seen a good certificate and thus forget any |
| 3336 // user exceptions for that host. See https://crbug.com/516808. | 3334 // user exceptions for that host. See https://crbug.com/516808. |
| 3337 TEST_F(WebContentsImplTest, LoadResourceWithEmptySecurityInfo) { | 3335 TEST_F(WebContentsImplTest, LoadResourceWithEmptySecurityInfo) { |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3414 // An automatic navigation. | 3412 // An automatic navigation. |
| 3415 main_test_rfh()->SendNavigateWithModificationCallback( | 3413 main_test_rfh()->SendNavigateWithModificationCallback( |
| 3416 0, true, GURL(url::kAboutBlankURL), base::Bind(SetAsNonUserGesture)); | 3414 0, true, GURL(url::kAboutBlankURL), base::Bind(SetAsNonUserGesture)); |
| 3417 | 3415 |
| 3418 EXPECT_EQ(1u, dialog_manager.reset_count()); | 3416 EXPECT_EQ(1u, dialog_manager.reset_count()); |
| 3419 | 3417 |
| 3420 contents()->SetJavaScriptDialogManagerForTesting(nullptr); | 3418 contents()->SetJavaScriptDialogManagerForTesting(nullptr); |
| 3421 } | 3419 } |
| 3422 | 3420 |
| 3423 } // namespace content | 3421 } // namespace content |
| OLD | NEW |