| OLD | NEW |
| 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 "ppapi/tests/test_graphics_2d.h" | 5 #include "ppapi/tests/test_graphics_2d.h" |
| 6 | 6 |
| 7 #include <stdlib.h> | 7 #include <stdlib.h> |
| 8 #include <string.h> | 8 #include <string.h> |
| 9 | 9 |
| 10 #include <set> | 10 #include <set> |
| (...skipping 635 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 646 is_view_changed_ = true; | 646 is_view_changed_ = true; |
| 647 testing_interface_->QuitMessageLoop(instance_->pp_instance()); | 647 testing_interface_->QuitMessageLoop(instance_->pp_instance()); |
| 648 } | 648 } |
| 649 } | 649 } |
| 650 | 650 |
| 651 void TestGraphics2D::ResetViewChangedState() { | 651 void TestGraphics2D::ResetViewChangedState() { |
| 652 is_view_changed_ = false; | 652 is_view_changed_ = false; |
| 653 } | 653 } |
| 654 | 654 |
| 655 bool TestGraphics2D::WaitUntilViewChanged() { | 655 bool TestGraphics2D::WaitUntilViewChanged() { |
| 656 // Run a nested message loop. It will exit either on ViewChanged or if the | 656 // Run a nested run loop. It will exit either on ViewChanged or if the |
| 657 // timeout happens. | 657 // timeout happens. |
| 658 | 658 |
| 659 // If view changed before we have chance to run message loop, return directly. | 659 // If view changed before we have chance to run message loop, return directly. |
| 660 if (is_view_changed_) | 660 if (is_view_changed_) |
| 661 return true; | 661 return true; |
| 662 | 662 |
| 663 post_quit_on_view_changed_ = true; | 663 post_quit_on_view_changed_ = true; |
| 664 testing_interface_->RunMessageLoop(instance_->pp_instance()); | 664 testing_interface_->RunMessageLoop(instance_->pp_instance()); |
| 665 post_quit_on_view_changed_ = false; | 665 post_quit_on_view_changed_ = false; |
| 666 | 666 |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 797 pp::Graphics2D dc(instance_, pp::Size(w, h), false); | 797 pp::Graphics2D dc(instance_, pp::Size(w, h), false); |
| 798 ASSERT_FALSE(dc.is_null()); | 798 ASSERT_FALSE(dc.is_null()); |
| 799 ASSERT_TRUE(instance_->BindGraphics(dc)); | 799 ASSERT_TRUE(instance_->BindGraphics(dc)); |
| 800 | 800 |
| 801 ASSERT_TRUE(instance_->BindGraphics(pp::Graphics2D())); | 801 ASSERT_TRUE(instance_->BindGraphics(pp::Graphics2D())); |
| 802 ASSERT_TRUE(instance_->BindGraphics(pp::Graphics3D())); | 802 ASSERT_TRUE(instance_->BindGraphics(pp::Graphics3D())); |
| 803 | 803 |
| 804 PASS(); | 804 PASS(); |
| 805 } | 805 } |
| 806 | 806 |
| OLD | NEW |