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

Side by Side Diff: ui/compositor/test/in_process_context_factory.cc

Issue 468393005: app_shell: Shut down in response to power button. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix a comment Created 6 years, 4 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 | Annotate | Revision Log
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 "ui/compositor/test/in_process_context_factory.h" 5 #include "ui/compositor/test/in_process_context_factory.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/threading/thread.h" 8 #include "base/threading/thread.h"
9 #include "cc/output/output_surface.h" 9 #include "cc/output/output_surface.h"
10 #include "cc/test/test_shared_bitmap_manager.h" 10 #include "cc/test/test_shared_bitmap_manager.h"
11 #include "ui/compositor/compositor_switches.h" 11 #include "ui/compositor/compositor_switches.h"
12 #include "ui/compositor/reflector.h" 12 #include "ui/compositor/reflector.h"
13 #include "ui/gl/gl_implementation.h" 13 #include "ui/gl/gl_implementation.h"
14 #include "ui/gl/gl_surface.h" 14 #include "ui/gl/gl_surface.h"
15 #include "webkit/common/gpu/context_provider_in_process.h" 15 #include "webkit/common/gpu/context_provider_in_process.h"
16 #include "webkit/common/gpu/grcontext_for_webgraphicscontext3d.h" 16 #include "webkit/common/gpu/grcontext_for_webgraphicscontext3d.h"
17 #include "webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl. h" 17 #include "webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl. h"
18 18
19 namespace ui { 19 namespace ui {
20 20
21 InProcessContextFactory::InProcessContextFactory() 21 InProcessContextFactory::InProcessContextFactory()
22 : shared_bitmap_manager_(new cc::TestSharedBitmapManager()) { 22 : shared_bitmap_manager_(new cc::TestSharedBitmapManager()) {
23 #if defined(UNIT_TEST)
James Cook 2014/08/23 00:55:00 I'm not sure this works. In particular, I think on
Daniel Erat 2014/08/23 02:21:31 what you write makes sense. it worked when i teste
24 CHECK_NE(gfx::GetGLImplementation(), gfx::kGLImplementationNone)
25 << "Ensure that the test binary's main() is calling "
26 << "gfx::GLSurface::InitializeOneOffForTests()";
27 #else
23 DCHECK_NE(gfx::GetGLImplementation(), gfx::kGLImplementationNone); 28 DCHECK_NE(gfx::GetGLImplementation(), gfx::kGLImplementationNone);
29 #endif
30
24 #if defined(OS_CHROMEOS) 31 #if defined(OS_CHROMEOS)
25 bool use_thread = !CommandLine::ForCurrentProcess()->HasSwitch( 32 bool use_thread = !CommandLine::ForCurrentProcess()->HasSwitch(
26 switches::kUIDisableThreadedCompositing); 33 switches::kUIDisableThreadedCompositing);
27 #else 34 #else
28 bool use_thread = false; 35 bool use_thread = false;
29 #endif 36 #endif
30 if (use_thread) { 37 if (use_thread) {
31 compositor_thread_.reset(new base::Thread("Browser Compositor")); 38 compositor_thread_.reset(new base::Thread("Browser Compositor"));
32 compositor_thread_->Start(); 39 compositor_thread_->Start();
33 } 40 }
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 return shared_bitmap_manager_.get(); 100 return shared_bitmap_manager_.get();
94 } 101 }
95 102
96 base::MessageLoopProxy* InProcessContextFactory::GetCompositorMessageLoop() { 103 base::MessageLoopProxy* InProcessContextFactory::GetCompositorMessageLoop() {
97 if (!compositor_thread_) 104 if (!compositor_thread_)
98 return NULL; 105 return NULL;
99 return compositor_thread_->message_loop_proxy(); 106 return compositor_thread_->message_loop_proxy();
100 } 107 }
101 108
102 } // namespace ui 109 } // namespace ui
OLDNEW
« extensions/test/extensions_unittests_main.cc ('K') | « extensions/test/extensions_unittests_main.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698