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

Side by Side Diff: content/public/test/render_view_test.cc

Issue 1501343002: Prepare chrome to use the new Mojo EDK by default. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: disable turning on in this cl Created 5 years 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 (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 "content/public/test/render_view_test.h" 5 #include "content/public/test/render_view_test.h"
6 6
7 #include <cctype> 7 #include <cctype>
8 8
9 #include "base/location.h" 9 #include "base/location.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 view_params.hidden = false; 269 view_params.hidden = false;
270 view_params.never_visible = false; 270 view_params.never_visible = false;
271 view_params.next_page_id = 1; 271 view_params.next_page_id = 1;
272 view_params.initial_size = *InitialSizeParams(); 272 view_params.initial_size = *InitialSizeParams();
273 view_params.enable_auto_resize = false; 273 view_params.enable_auto_resize = false;
274 view_params.min_size = gfx::Size(); 274 view_params.min_size = gfx::Size();
275 view_params.max_size = gfx::Size(); 275 view_params.max_size = gfx::Size();
276 276
277 #if !defined(OS_IOS) 277 #if !defined(OS_IOS)
278 InitializeMojo(); 278 InitializeMojo();
279 if (base::CommandLine::ForCurrentProcess()->HasSwitch("use-new-edk")) {
280 test_io_thread_.reset(new base::TestIOThread(
281 base::TestIOThread::kAutoStart));
282 ipc_support_.reset(new mojo::test::ScopedIPCSupport(
283 test_io_thread_->task_runner()));
284 }
279 #endif 285 #endif
280 286
281 // This needs to pass the mock render thread to the view. 287 // This needs to pass the mock render thread to the view.
282 RenderViewImpl* view = 288 RenderViewImpl* view =
283 RenderViewImpl::Create(compositor_deps_.get(), view_params, false); 289 RenderViewImpl::Create(compositor_deps_.get(), view_params, false);
284 view_ = view; 290 view_ = view;
285 } 291 }
286 292
287 void RenderViewTest::TearDown() { 293 void RenderViewTest::TearDown() {
288 // Run the loop so the release task from the renderwidget executes. 294 // Run the loop so the release task from the renderwidget executes.
(...skipping 21 matching lines...) Expand all
310 316
311 leak_detector->collectGarbageAndReport(); 317 leak_detector->collectGarbageAndReport();
312 318
313 blink_platform_impl_.Shutdown(); 319 blink_platform_impl_.Shutdown();
314 blink::shutdown(); 320 blink::shutdown();
315 321
316 platform_->PlatformUninitialize(); 322 platform_->PlatformUninitialize();
317 platform_.reset(); 323 platform_.reset();
318 params_.reset(); 324 params_.reset();
319 command_line_.reset(); 325 command_line_.reset();
326
327 test_io_thread_.reset();
328 ipc_support_.reset();
320 } 329 }
321 330
322 void RenderViewTest::onLeakDetectionComplete(const Result& result) { 331 void RenderViewTest::onLeakDetectionComplete(const Result& result) {
323 EXPECT_EQ(0u, result.numberOfLiveAudioNodes); 332 EXPECT_EQ(0u, result.numberOfLiveAudioNodes);
324 EXPECT_EQ(0u, result.numberOfLiveDocuments); 333 EXPECT_EQ(0u, result.numberOfLiveDocuments);
325 EXPECT_EQ(0u, result.numberOfLiveNodes); 334 EXPECT_EQ(0u, result.numberOfLiveNodes);
326 EXPECT_EQ(0u, result.numberOfLiveLayoutObjects); 335 EXPECT_EQ(0u, result.numberOfLiveLayoutObjects);
327 EXPECT_EQ(0u, result.numberOfLiveResources); 336 EXPECT_EQ(0u, result.numberOfLiveResources);
328 EXPECT_EQ(0u, result.numberOfLiveActiveDOMObjects); 337 EXPECT_EQ(0u, result.numberOfLiveActiveDOMObjects);
329 EXPECT_EQ(0u, result.numberOfLiveScriptPromises); 338 EXPECT_EQ(0u, result.numberOfLiveScriptPromises);
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
614 TestRenderFrame* frame = 623 TestRenderFrame* frame =
615 static_cast<TestRenderFrame*>(impl->GetMainRenderFrame()); 624 static_cast<TestRenderFrame*>(impl->GetMainRenderFrame());
616 frame->Navigate(common_params, StartNavigationParams(), request_params); 625 frame->Navigate(common_params, StartNavigationParams(), request_params);
617 626
618 // The load actually happens asynchronously, so we pump messages to process 627 // The load actually happens asynchronously, so we pump messages to process
619 // the pending continuation. 628 // the pending continuation.
620 FrameLoadWaiter(frame).Wait(); 629 FrameLoadWaiter(frame).Wait();
621 } 630 }
622 631
623 } // namespace content 632 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698