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

Side by Side Diff: content/common/gpu/gpu_channel_manager_unittest.cc

Issue 1184523003: attachment broker wip (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Minor comments. Created 5 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
« no previous file with comments | « content/common/gpu/gpu_channel_manager.cc ('k') | content/gpu/gpu_child_thread.cc » ('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) 2014 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 "base/run_loop.h" 5 #include "base/run_loop.h"
6 #include "base/synchronization/waitable_event.h" 6 #include "base/synchronization/waitable_event.h"
7 #include "base/test/test_simple_task_runner.h" 7 #include "base/test/test_simple_task_runner.h"
8 #include "content/common/gpu/gpu_channel.h" 8 #include "content/common/gpu/gpu_channel.h"
9 #include "content/common/gpu/gpu_channel_manager.h" 9 #include "content/common/gpu/gpu_channel_manager.h"
10 #include "content/common/gpu/gpu_messages.h" 10 #include "content/common/gpu/gpu_messages.h"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 channel_.reset(); 50 channel_.reset();
51 51
52 ipc_done.Wait(); 52 ipc_done.Wait();
53 ipc_thread_.Stop(); 53 ipc_thread_.Stop();
54 } 54 }
55 55
56 protected: 56 protected:
57 SyncChannel* CreateChannel() { 57 SyncChannel* CreateChannel() {
58 scoped_ptr<SyncChannel> channel = SyncChannel::Create( 58 scoped_ptr<SyncChannel> channel = SyncChannel::Create(
59 channel_name_, mode_, this, ipc_thread_.task_runner().get(), true, 59 channel_name_, mode_, this, ipc_thread_.task_runner().get(), true,
60 &shutdown_event_); 60 &shutdown_event_, nullptr);
61 return channel.release(); 61 return channel.release();
62 } 62 }
63 63
64 void OnShutdown(WaitableEvent* ipc_event) { 64 void OnShutdown(WaitableEvent* ipc_event) {
65 base::RunLoop().RunUntilIdle(); 65 base::RunLoop().RunUntilIdle();
66 ipc_event->Signal(); 66 ipc_event->Signal();
67 } 67 }
68 68
69 const base::Thread& ipc_thread() const { return ipc_thread_; } 69 const base::Thread& ipc_thread() const { return ipc_thread_; }
70 70
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 public: 105 public:
106 SimpleGpuClient() 106 SimpleGpuClient()
107 : IPC::SimpleWorker(IPC::Channel::MODE_CLIENT, "simple_client"), 107 : IPC::SimpleWorker(IPC::Channel::MODE_CLIENT, "simple_client"),
108 router_(this) { 108 router_(this) {
109 } 109 }
110 110
111 void Start() override { 111 void Start() override {
112 IPC::SimpleWorker::Start(); 112 IPC::SimpleWorker::Start();
113 gpu_channel_manager_.reset( 113 gpu_channel_manager_.reset(
114 new GpuChannelManager(&router_, NULL, ipc_thread().task_runner().get(), 114 new GpuChannelManager(&router_, NULL, ipc_thread().task_runner().get(),
115 shutdown_event(), channel())); 115 shutdown_event(), channel(), nullptr));
116 } 116 }
117 117
118 void Shutdown() override { 118 void Shutdown() override {
119 gpu_channel_manager_.reset(); 119 gpu_channel_manager_.reset();
120 IPC::SimpleWorker::Shutdown(); 120 IPC::SimpleWorker::Shutdown();
121 } 121 }
122 122
123 GpuChannelManager* gpu_channel_manager() { 123 GpuChannelManager* gpu_channel_manager() {
124 return gpu_channel_manager_.get(); 124 return gpu_channel_manager_.get();
125 } 125 }
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 const ValueState* state2 = 214 const ValueState* state2 =
215 pending_value_buffer_state2->GetState(GL_MOUSE_POSITION_CHROMIUM); 215 pending_value_buffer_state2->GetState(GL_MOUSE_POSITION_CHROMIUM);
216 ASSERT_NE(state1, state2); 216 ASSERT_NE(state1, state2);
217 217
218 ASSERT_EQ(state1->int_value[0], value_state1.int_value[0]); 218 ASSERT_EQ(state1->int_value[0], value_state1.int_value[0]);
219 ASSERT_EQ(state2->int_value[0], value_state2.int_value[0]); 219 ASSERT_EQ(state2->int_value[0], value_state2.int_value[0]);
220 ASSERT_NE(state1->int_value[0], state2->int_value[0]); 220 ASSERT_NE(state1->int_value[0], state2->int_value[0]);
221 } 221 }
222 222
223 } // namespace content 223 } // namespace content
OLDNEW
« no previous file with comments | « content/common/gpu/gpu_channel_manager.cc ('k') | content/gpu/gpu_child_thread.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698