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

Side by Side Diff: content/browser/frame_host/navigator_impl_unittest.cc

Issue 2079623002: Create only one ContextFactory in content unit tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add dcheck Created 4 years, 6 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 6
7 #include "base/macros.h" 7 #include "base/macros.h"
8 #include "base/time/time.h" 8 #include "base/time/time.h"
9 #include "build/build_config.h" 9 #include "build/build_config.h"
10 #include "content/browser/frame_host/navigation_controller_impl.h" 10 #include "content/browser/frame_host/navigation_controller_impl.h"
(...skipping 30 matching lines...) Expand all
41 41
42 namespace content { 42 namespace content {
43 43
44 class NavigatorTestWithBrowserSideNavigation 44 class NavigatorTestWithBrowserSideNavigation
45 : public RenderViewHostImplTestHarness { 45 : public RenderViewHostImplTestHarness {
46 public: 46 public:
47 using SiteInstanceDescriptor = RenderFrameHostManager::SiteInstanceDescriptor; 47 using SiteInstanceDescriptor = RenderFrameHostManager::SiteInstanceDescriptor;
48 using SiteInstanceRelation = RenderFrameHostManager::SiteInstanceRelation; 48 using SiteInstanceRelation = RenderFrameHostManager::SiteInstanceRelation;
49 49
50 void SetUp() override { 50 void SetUp() override {
51 #if !defined(OS_ANDROID)
52 ImageTransportFactory::InitializeForUnitTests(
53 std::unique_ptr<ImageTransportFactory>(
54 new NoTransportImageTransportFactory));
55 #endif
56 EnableBrowserSideNavigation(); 51 EnableBrowserSideNavigation();
57 RenderViewHostImplTestHarness::SetUp(); 52 RenderViewHostImplTestHarness::SetUp();
58 } 53 }
59 54
60 void TearDown() override { 55 void TearDown() override {
61 RenderViewHostImplTestHarness::TearDown(); 56 RenderViewHostImplTestHarness::TearDown();
62 #if !defined(OS_ANDROID)
63 ImageTransportFactory::Terminate();
64 #endif
65 } 57 }
66 58
67 TestNavigationURLLoader* GetLoaderForNavigationRequest( 59 TestNavigationURLLoader* GetLoaderForNavigationRequest(
68 NavigationRequest* request) const { 60 NavigationRequest* request) const {
69 return static_cast<TestNavigationURLLoader*>(request->loader_for_testing()); 61 return static_cast<TestNavigationURLLoader*>(request->loader_for_testing());
70 } 62 }
71 63
72 // Requests a navigation of the specified FrameTreeNode to the specified URL; 64 // Requests a navigation of the specified FrameTreeNode to the specified URL;
73 // returns the unique ID of the pending NavigationEntry. 65 // returns the unique ID of the pending NavigationEntry.
74 int RequestNavigation(FrameTreeNode* node, const GURL& url) { 66 int RequestNavigation(FrameTreeNode* node, const GURL& url) {
(...skipping 1086 matching lines...) Expand 10 before | Expand all | Expand 10 after
1161 main_test_rfh()->PrepareForCommit(); 1153 main_test_rfh()->PrepareForCommit();
1162 1154
1163 // Claim that the navigation was within same page. 1155 // Claim that the navigation was within same page.
1164 int bad_msg_count = process()->bad_msg_count(); 1156 int bad_msg_count = process()->bad_msg_count();
1165 GetSpeculativeRenderFrameHost(node)->SendNavigateWithModificationCallback( 1157 GetSpeculativeRenderFrameHost(node)->SendNavigateWithModificationCallback(
1166 0, entry_id, true, kUrl2, base::Bind(SetWithinPage, kUrl1)); 1158 0, entry_id, true, kUrl2, base::Bind(SetWithinPage, kUrl1));
1167 EXPECT_EQ(process()->bad_msg_count(), bad_msg_count + 1); 1159 EXPECT_EQ(process()->bad_msg_count(), bad_msg_count + 1);
1168 } 1160 }
1169 1161
1170 } // namespace content 1162 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/compositor/surface_utils.h ('k') | content/browser/frame_host/render_frame_host_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698