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

Side by Side Diff: content/browser/web_contents/web_contents_impl_unittest.cc

Issue 1319073003: Organize Layout Hooks (content-side). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comments tweaked. Created 5 years, 3 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
« no previous file with comments | « content/browser/web_contents/web_contents_impl.cc ('k') | content/common/frame_messages.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 3281 matching lines...) Expand 10 before | Expand all | Expand 10 after
3292 test_rvh(), 3292 test_rvh(),
3293 FrameHostMsg_DidChangeThemeColor(rfh->GetRoutingID(), SK_ColorRED)); 3293 FrameHostMsg_DidChangeThemeColor(rfh->GetRoutingID(), SK_ColorRED));
3294 3294
3295 EXPECT_EQ(SK_ColorRED, contents()->GetThemeColor()); 3295 EXPECT_EQ(SK_ColorRED, contents()->GetThemeColor());
3296 EXPECT_EQ(transparent, observer.last_theme_color()); 3296 EXPECT_EQ(transparent, observer.last_theme_color());
3297 3297
3298 // Simulate that the first visually non-empty paint has occurred. This will 3298 // Simulate that the first visually non-empty paint has occurred. This will
3299 // propagate the current theme color to the delegates. 3299 // propagate the current theme color to the delegates.
3300 RenderViewHostTester::TestOnMessageReceived( 3300 RenderViewHostTester::TestOnMessageReceived(
3301 test_rvh(), 3301 test_rvh(),
3302 FrameHostMsg_DidFirstVisuallyNonEmptyPaint(rfh->GetRoutingID())); 3302 ViewHostMsg_DidFirstVisuallyNonEmptyPaint(rfh->GetRoutingID()));
3303 3303
3304 EXPECT_EQ(SK_ColorRED, contents()->GetThemeColor()); 3304 EXPECT_EQ(SK_ColorRED, contents()->GetThemeColor());
3305 EXPECT_EQ(SK_ColorRED, observer.last_theme_color()); 3305 EXPECT_EQ(SK_ColorRED, observer.last_theme_color());
3306 3306
3307 // Additional changes made by the web contents should propagate as well. 3307 // Additional changes made by the web contents should propagate as well.
3308 RenderViewHostTester::TestOnMessageReceived( 3308 RenderViewHostTester::TestOnMessageReceived(
3309 test_rvh(), 3309 test_rvh(),
3310 FrameHostMsg_DidChangeThemeColor(rfh->GetRoutingID(), SK_ColorGREEN)); 3310 FrameHostMsg_DidChangeThemeColor(rfh->GetRoutingID(), SK_ColorGREEN));
3311 3311
3312 EXPECT_EQ(SK_ColorGREEN, contents()->GetThemeColor()); 3312 EXPECT_EQ(SK_ColorGREEN, contents()->GetThemeColor());
3313 EXPECT_EQ(SK_ColorGREEN, observer.last_theme_color()); 3313 EXPECT_EQ(SK_ColorGREEN, observer.last_theme_color());
3314 } 3314 }
3315 3315
3316 // Test that if a renderer reports that it has loaded a resource from 3316 // Test that if a renderer reports that it has loaded a resource from
3317 // memory cache with bad security info (i.e. can't be deserialized), the 3317 // memory cache with bad security info (i.e. can't be deserialized), the
3318 // renderer gets killed. 3318 // renderer gets killed.
3319 TEST_F(WebContentsImplTest, LoadResourceFromMemoryCacheWithBadSecurityInfo) { 3319 TEST_F(WebContentsImplTest, LoadResourceFromMemoryCacheWithBadSecurityInfo) {
3320 MockRenderProcessHost* rph = contents()->GetMainFrame()->GetProcess(); 3320 MockRenderProcessHost* rph = contents()->GetMainFrame()->GetProcess();
3321 EXPECT_EQ(0, rph->bad_msg_count()); 3321 EXPECT_EQ(0, rph->bad_msg_count());
3322 3322
3323 contents()->OnDidLoadResourceFromMemoryCache( 3323 contents()->OnDidLoadResourceFromMemoryCache(
3324 GURL("http://example.test"), "not valid security info", "GET", 3324 GURL("http://example.test"), "not valid security info", "GET",
3325 "mime type", RESOURCE_TYPE_MAIN_FRAME); 3325 "mime type", RESOURCE_TYPE_MAIN_FRAME);
3326 EXPECT_EQ(1, rph->bad_msg_count()); 3326 EXPECT_EQ(1, rph->bad_msg_count());
3327 } 3327 }
3328 3328
3329 } // namespace content 3329 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/web_contents/web_contents_impl.cc ('k') | content/common/frame_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698