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

Side by Side Diff: cc/scheduler_unittest.cc

Issue 11192030: cc: Switch to Chromium DCHECKs LOGs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebaseonenne Created 8 years, 2 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
« no previous file with comments | « cc/scheduler_state_machine.cc ('k') | cc/scoped_ptr_deque.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 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 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 "config.h" 5 #include "config.h"
6 6
7 #include "CCScheduler.h" 7 #include "CCScheduler.h"
8 8
9 #include "base/logging.h"
9 #include "cc/test/scheduler_test_common.h" 10 #include "cc/test/scheduler_test_common.h"
10 #include "testing/gmock/include/gmock/gmock.h" 11 #include "testing/gmock/include/gmock/gmock.h"
11 #include "testing/gtest/include/gtest/gtest.h" 12 #include "testing/gtest/include/gtest/gtest.h"
12 13
13 using namespace cc; 14 using namespace cc;
14 using namespace WebKitTests; 15 using namespace WebKitTests;
15 16
16 namespace { 17 namespace {
17 18
18 class FakeCCSchedulerClient : public CCSchedulerClient { 19 class FakeCCSchedulerClient : public CCSchedulerClient {
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 virtual CCScheduledActionDrawAndSwapResult scheduledActionDrawAndSwapIfPossi ble() OVERRIDE 215 virtual CCScheduledActionDrawAndSwapResult scheduledActionDrawAndSwapIfPossi ble() OVERRIDE
215 { 216 {
216 // Only setNeedsRedraw the first time this is called 217 // Only setNeedsRedraw the first time this is called
217 if (!m_numDraws) 218 if (!m_numDraws)
218 m_scheduler->setNeedsRedraw(); 219 m_scheduler->setNeedsRedraw();
219 return FakeCCSchedulerClient::scheduledActionDrawAndSwapIfPossible(); 220 return FakeCCSchedulerClient::scheduledActionDrawAndSwapIfPossible();
220 } 221 }
221 222
222 virtual CCScheduledActionDrawAndSwapResult scheduledActionDrawAndSwapForced( ) OVERRIDE 223 virtual CCScheduledActionDrawAndSwapResult scheduledActionDrawAndSwapForced( ) OVERRIDE
223 { 224 {
224 ASSERT_NOT_REACHED(); 225 NOTREACHED();
225 return CCScheduledActionDrawAndSwapResult(true, true); 226 return CCScheduledActionDrawAndSwapResult(true, true);
226 } 227 }
227 228
228 virtual void scheduledActionCommit() OVERRIDE { } 229 virtual void scheduledActionCommit() OVERRIDE { }
229 virtual void scheduledActionBeginContextRecreation() OVERRIDE { } 230 virtual void scheduledActionBeginContextRecreation() OVERRIDE { }
230 virtual void didAnticipatedDrawTimeChange(base::TimeTicks) OVERRIDE { } 231 virtual void didAnticipatedDrawTimeChange(base::TimeTicks) OVERRIDE { }
231 232
232 protected: 233 protected:
233 CCScheduler* m_scheduler; 234 CCScheduler* m_scheduler;
234 }; 235 };
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
316 virtual CCScheduledActionDrawAndSwapResult scheduledActionDrawAndSwapIfPossi ble() OVERRIDE 317 virtual CCScheduledActionDrawAndSwapResult scheduledActionDrawAndSwapIfPossi ble() OVERRIDE
317 { 318 {
318 // Only setNeedsCommit the first time this is called 319 // Only setNeedsCommit the first time this is called
319 if (!m_numDraws) 320 if (!m_numDraws)
320 m_scheduler->setNeedsCommit(); 321 m_scheduler->setNeedsCommit();
321 return FakeCCSchedulerClient::scheduledActionDrawAndSwapIfPossible(); 322 return FakeCCSchedulerClient::scheduledActionDrawAndSwapIfPossible();
322 } 323 }
323 324
324 virtual CCScheduledActionDrawAndSwapResult scheduledActionDrawAndSwapForced( ) OVERRIDE 325 virtual CCScheduledActionDrawAndSwapResult scheduledActionDrawAndSwapForced( ) OVERRIDE
325 { 326 {
326 ASSERT_NOT_REACHED(); 327 NOTREACHED();
327 return CCScheduledActionDrawAndSwapResult(true, true); 328 return CCScheduledActionDrawAndSwapResult(true, true);
328 } 329 }
329 330
330 virtual void scheduledActionCommit() OVERRIDE { } 331 virtual void scheduledActionCommit() OVERRIDE { }
331 virtual void scheduledActionBeginContextRecreation() OVERRIDE { } 332 virtual void scheduledActionBeginContextRecreation() OVERRIDE { }
332 virtual void didAnticipatedDrawTimeChange(base::TimeTicks) OVERRIDE { } 333 virtual void didAnticipatedDrawTimeChange(base::TimeTicks) OVERRIDE { }
333 334
334 protected: 335 protected:
335 CCScheduler* m_scheduler; 336 CCScheduler* m_scheduler;
336 }; 337 };
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
460 // Get the compositor to do a scheduledActionDrawAndSwapForced. 461 // Get the compositor to do a scheduledActionDrawAndSwapForced.
461 scheduler->setNeedsRedraw(); 462 scheduler->setNeedsRedraw();
462 scheduler->setNeedsForcedRedraw(); 463 scheduler->setNeedsForcedRedraw();
463 EXPECT_TRUE(client.hasAction("scheduledActionDrawAndSwapForced")); 464 EXPECT_TRUE(client.hasAction("scheduledActionDrawAndSwapForced"));
464 465
465 // We should not have told the frame rate controller that we began a frame. 466 // We should not have told the frame rate controller that we began a frame.
466 EXPECT_EQ(0, controllerPtr->numFramesPending()); 467 EXPECT_EQ(0, controllerPtr->numFramesPending());
467 } 468 }
468 469
469 } 470 }
OLDNEW
« no previous file with comments | « cc/scheduler_state_machine.cc ('k') | cc/scoped_ptr_deque.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698