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

Side by Side Diff: android_webview/browser/test/rendering_test.cc

Issue 2457353002: aw: Enable async ondraw (Closed)
Patch Set: fix unit tests Created 4 years, 1 month 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 | « android_webview/browser/render_thread_manager.cc ('k') | android_webview/common/aw_switches.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 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 "android_webview/browser/test/rendering_test.h" 5 #include "android_webview/browser/test/rendering_test.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "android_webview/browser/browser_view_renderer.h" 9 #include "android_webview/browser/browser_view_renderer.h"
10 #include "android_webview/browser/child_frame.h" 10 #include "android_webview/browser/child_frame.h"
11 #include "android_webview/browser/render_thread_manager.h" 11 #include "android_webview/browser/render_thread_manager.h"
12 #include "android_webview/common/aw_switches.h"
13 #include "base/command_line.h"
12 #include "base/location.h" 14 #include "base/location.h"
13 #include "base/threading/thread_task_runner_handle.h" 15 #include "base/threading/thread_task_runner_handle.h"
14 #include "cc/output/compositor_frame.h" 16 #include "cc/output/compositor_frame.h"
15 #include "content/public/browser/android/synchronous_compositor.h" 17 #include "content/public/browser/android/synchronous_compositor.h"
16 #include "content/public/test/test_synchronous_compositor_android.h" 18 #include "content/public/test/test_synchronous_compositor_android.h"
17 19
18 namespace android_webview { 20 namespace android_webview {
19 21
20 namespace { 22 namespace {
21 // BrowserViewRenderer subclass used for enabling tests to observe 23 // BrowserViewRenderer subclass used for enabling tests to observe
(...skipping 14 matching lines...) Expand all
36 compositor_frame_consumer); 38 compositor_frame_consumer);
37 rendering_test_->OnParentDrawConstraintsUpdated(); 39 rendering_test_->OnParentDrawConstraintsUpdated();
38 } 40 }
39 41
40 private: 42 private:
41 RenderingTest* const rendering_test_; 43 RenderingTest* const rendering_test_;
42 }; 44 };
43 } 45 }
44 46
45 RenderingTest::RenderingTest() : message_loop_(new base::MessageLoop) { 47 RenderingTest::RenderingTest() : message_loop_(new base::MessageLoop) {
48 // TODO(boliu): Update unit tests to async code path.
49 base::CommandLine::ForCurrentProcess()->AppendSwitch(
50 switches::kSyncOnDrawHardware);
46 ui_task_runner_ = base::ThreadTaskRunnerHandle::Get(); 51 ui_task_runner_ = base::ThreadTaskRunnerHandle::Get();
47 } 52 }
48 53
49 RenderingTest::~RenderingTest() { 54 RenderingTest::~RenderingTest() {
50 DCHECK(ui_task_runner_->BelongsToCurrentThread()); 55 DCHECK(ui_task_runner_->BelongsToCurrentThread());
51 if (window_.get()) 56 if (window_.get())
52 window_->Detach(); 57 window_->Detach();
53 } 58 }
54 59
55 ui::TouchHandleDrawable* RenderingTest::CreateDrawable() { 60 ui::TouchHandleDrawable* RenderingTest::CreateDrawable() {
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 void RenderingTest::PostInvalidate() { 157 void RenderingTest::PostInvalidate() {
153 if (window_) 158 if (window_)
154 window_->PostInvalidate(); 159 window_->PostInvalidate();
155 } 160 }
156 161
157 gfx::Point RenderingTest::GetLocationOnScreen() { 162 gfx::Point RenderingTest::GetLocationOnScreen() {
158 return gfx::Point(); 163 return gfx::Point();
159 } 164 }
160 165
161 } // namespace android_webview 166 } // namespace android_webview
OLDNEW
« no previous file with comments | « android_webview/browser/render_thread_manager.cc ('k') | android_webview/common/aw_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698