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

Side by Side Diff: ui/compositor/layer_unittest.cc

Issue 14061025: ui: Use base::MessageLoop. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 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 | « ui/compositor/compositor.cc ('k') | ui/compositor/test/test_compositor_host_linux.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) 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 "base/basictypes.h" 5 #include "base/basictypes.h"
6 #include "base/bind.h" 6 #include "base/bind.h"
7 #include "base/compiler_specific.h" 7 #include "base/compiler_specific.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after
428 } 428 }
429 429
430 void WaitForDraw() { 430 void WaitForDraw() {
431 DrawWaiterForTest::Wait(compositor()); 431 DrawWaiterForTest::Wait(compositor());
432 } 432 }
433 433
434 // CompositorDelegate overrides. 434 // CompositorDelegate overrides.
435 virtual void ScheduleDraw() OVERRIDE { 435 virtual void ScheduleDraw() OVERRIDE {
436 DCHECK(!ui::Compositor::WasInitializedWithThread()); 436 DCHECK(!ui::Compositor::WasInitializedWithThread());
437 if (compositor_) { 437 if (compositor_) {
438 MessageLoop::current()->PostTask( 438 base::MessageLoop::current()->PostTask(
439 FROM_HERE, 439 FROM_HERE, base::Bind(&Compositor::Draw, compositor_->AsWeakPtr()));
440 base::Bind(&Compositor::Draw, compositor_->AsWeakPtr()));
441 } 440 }
442 } 441 }
443 442
444 private: 443 private:
445 scoped_ptr<Compositor> compositor_; 444 scoped_ptr<Compositor> compositor_;
446 445
447 DISALLOW_COPY_AND_ASSIGN(LayerWithDelegateTest); 446 DISALLOW_COPY_AND_ASSIGN(LayerWithDelegateTest);
448 }; 447 };
449 448
450 // L1 449 // L1
(...skipping 922 matching lines...) Expand 10 before | Expand all | Expand 10 after
1373 l1->SetOpacity(0.5f); 1372 l1->SetOpacity(0.5f);
1374 1373
1375 // Change l1's cc::Layer. 1374 // Change l1's cc::Layer.
1376 l1->SwitchCCLayerForTest(); 1375 l1->SwitchCCLayerForTest();
1377 1376
1378 // Ensure that the opacity animation completed. 1377 // Ensure that the opacity animation completed.
1379 EXPECT_FLOAT_EQ(l1->opacity(), 0.5f); 1378 EXPECT_FLOAT_EQ(l1->opacity(), 0.5f);
1380 } 1379 }
1381 1380
1382 } // namespace ui 1381 } // namespace ui
OLDNEW
« no previous file with comments | « ui/compositor/compositor.cc ('k') | ui/compositor/test/test_compositor_host_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698