| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "ppapi/tests/test_scrollbar.h" | 5 #include "ppapi/tests/test_scrollbar.h" |
| 6 | 6 |
| 7 #include <cstring> | 7 #include <cstring> |
| 8 | 8 |
| 9 #include "ppapi/c/dev/ppb_testing_dev.h" | 9 #include "ppapi/c/dev/ppb_testing_dev.h" |
| 10 #include "ppapi/c/pp_input_event.h" | 10 #include "ppapi/c/pp_input_event.h" |
| 11 #include "ppapi/cpp/input_event.h" | 11 #include "ppapi/cpp/input_event.h" |
| 12 #include "ppapi/cpp/instance.h" | 12 #include "ppapi/cpp/instance.h" |
| 13 #include "ppapi/cpp/rect.h" | 13 #include "ppapi/cpp/rect.h" |
| 14 #include "ppapi/tests/testing_instance.h" | 14 #include "ppapi/tests/testing_instance.h" |
| 15 | 15 |
| 16 REGISTER_TEST_CASE(Scrollbar); | 16 REGISTER_TEST_CASE(Scrollbar); |
| 17 | 17 |
| 18 TestScrollbar::TestScrollbar(TestingInstance* instance) | 18 TestScrollbar::TestScrollbar(TestingInstance* instance) |
| 19 : TestCase(instance), | 19 : TestCase(instance), |
| 20 WidgetClient_Dev(instance), | 20 WidgetClient_Dev(instance), |
| 21 scrollbar_(instance, true), | 21 scrollbar_(instance, true), |
| 22 scrollbar_value_changed_(false) { | 22 scrollbar_value_changed_(false) { |
| 23 } | 23 } |
| 24 | 24 |
| 25 bool TestScrollbar::Init() { | 25 bool TestScrollbar::Init() { |
| 26 return CheckTestingInterface(); | 26 return CheckTestingInterface(); |
| 27 } | 27 } |
| 28 | 28 |
| 29 void TestScrollbar::RunTests(const std::string& filter) { | 29 void TestScrollbar::RunTests(const std::string& filter) { |
| 30 instance_->LogTest("HandleEvent", TestHandleEvent()); | 30 RUN_TEST(HandleEvent, filter); |
| 31 } | 31 } |
| 32 | 32 |
| 33 std::string TestScrollbar::TestHandleEvent() { | 33 std::string TestScrollbar::TestHandleEvent() { |
| 34 pp::Rect location; | 34 pp::Rect location; |
| 35 location.set_width(1000); | 35 location.set_width(1000); |
| 36 location.set_height(1000); | 36 location.set_height(1000); |
| 37 scrollbar_.SetLocation(location); | 37 scrollbar_.SetLocation(location); |
| 38 | 38 |
| 39 scrollbar_.SetDocumentSize(10000); | 39 scrollbar_.SetDocumentSize(10000); |
| 40 | 40 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 57 | 57 |
| 58 void TestScrollbar::ScrollbarValueChanged(pp::Scrollbar_Dev scrollbar, | 58 void TestScrollbar::ScrollbarValueChanged(pp::Scrollbar_Dev scrollbar, |
| 59 uint32_t value) { | 59 uint32_t value) { |
| 60 if (scrollbar == scrollbar_) | 60 if (scrollbar == scrollbar_) |
| 61 scrollbar_value_changed_ = true; | 61 scrollbar_value_changed_ = true; |
| 62 } | 62 } |
| 63 | 63 |
| 64 void TestScrollbar::ScrollbarOverlayChanged(pp::Scrollbar_Dev scrollbar, | 64 void TestScrollbar::ScrollbarOverlayChanged(pp::Scrollbar_Dev scrollbar, |
| 65 bool type) { | 65 bool type) { |
| 66 } | 66 } |
| OLD | NEW |