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 "base/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/logging.h" | 6 #include "base/logging.h" |
7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
8 #include "content/browser/frame_host/cross_site_transferring_request.h" | 8 #include "content/browser/frame_host/cross_site_transferring_request.h" |
9 #include "content/browser/frame_host/interstitial_page_impl.h" | 9 #include "content/browser/frame_host/interstitial_page_impl.h" |
10 #include "content/browser/frame_host/navigation_entry_impl.h" | 10 #include "content/browser/frame_host/navigation_entry_impl.h" |
(...skipping 1427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1438 } | 1438 } |
1439 | 1439 |
1440 contents()->SetDelegate(nullptr); | 1440 contents()->SetDelegate(nullptr); |
1441 } | 1441 } |
1442 | 1442 |
1443 TEST_F(WebContentsImplTest, TerminateHidesValidationMessage) { | 1443 TEST_F(WebContentsImplTest, TerminateHidesValidationMessage) { |
1444 FakeValidationMessageDelegate fake_delegate; | 1444 FakeValidationMessageDelegate fake_delegate; |
1445 contents()->SetDelegate(&fake_delegate); | 1445 contents()->SetDelegate(&fake_delegate); |
1446 EXPECT_FALSE(fake_delegate.hide_validation_message_was_called()); | 1446 EXPECT_FALSE(fake_delegate.hide_validation_message_was_called()); |
1447 | 1447 |
1448 // Crash the renderer. | 1448 // Initialize the RenderFrame and then simulate crashing the renderer |
| 1449 // process. |
| 1450 contents()->GetMainFrame()->InitializeRenderFrameIfNeeded(); |
1449 contents()->GetMainFrame()->GetProcess()->SimulateCrash(); | 1451 contents()->GetMainFrame()->GetProcess()->SimulateCrash(); |
1450 | 1452 |
1451 // Confirm HideValidationMessage was called. | 1453 // Confirm HideValidationMessage was called. |
1452 EXPECT_TRUE(fake_delegate.hide_validation_message_was_called()); | 1454 EXPECT_TRUE(fake_delegate.hide_validation_message_was_called()); |
1453 | 1455 |
1454 contents()->SetDelegate(nullptr); | 1456 contents()->SetDelegate(nullptr); |
1455 } | 1457 } |
1456 | 1458 |
1457 // Tests that fullscreen is exited throughout the object hierarchy on a renderer | 1459 // Tests that fullscreen is exited throughout the object hierarchy on a renderer |
1458 // crash. | 1460 // crash. |
(...skipping 1699 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3158 // Additional changes made by the web contents should propagate as well. | 3160 // Additional changes made by the web contents should propagate as well. |
3159 RenderViewHostTester::TestOnMessageReceived( | 3161 RenderViewHostTester::TestOnMessageReceived( |
3160 test_rvh(), | 3162 test_rvh(), |
3161 FrameHostMsg_DidChangeThemeColor(rfh->GetRoutingID(), SK_ColorGREEN)); | 3163 FrameHostMsg_DidChangeThemeColor(rfh->GetRoutingID(), SK_ColorGREEN)); |
3162 | 3164 |
3163 EXPECT_EQ(SK_ColorGREEN, contents()->GetThemeColor()); | 3165 EXPECT_EQ(SK_ColorGREEN, contents()->GetThemeColor()); |
3164 EXPECT_EQ(SK_ColorGREEN, observer.last_theme_color()); | 3166 EXPECT_EQ(SK_ColorGREEN, observer.last_theme_color()); |
3165 } | 3167 } |
3166 | 3168 |
3167 } // namespace content | 3169 } // namespace content |
OLD | NEW |