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_flash_fullscreen.h" | 5 #include "ppapi/tests/test_flash_fullscreen.h" |
6 | 6 |
7 #include <stdio.h> | 7 #include <stdio.h> |
8 #include <string.h> | 8 #include <string.h> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 28 matching lines...) Expand all Loading... |
39 : TestCase(instance), | 39 : TestCase(instance), |
40 screen_mode_(instance), | 40 screen_mode_(instance), |
41 fullscreen_pending_(false), | 41 fullscreen_pending_(false), |
42 normal_pending_(false), | 42 normal_pending_(false), |
43 fullscreen_callback_(instance->pp_instance()), | 43 fullscreen_callback_(instance->pp_instance()), |
44 normal_callback_(instance->pp_instance()) { | 44 normal_callback_(instance->pp_instance()) { |
45 screen_mode_.GetScreenSize(&screen_size_); | 45 screen_mode_.GetScreenSize(&screen_size_); |
46 } | 46 } |
47 | 47 |
48 bool TestFlashFullscreen::Init() { | 48 bool TestFlashFullscreen::Init() { |
49 return InitTestingInterface(); | 49 return CheckTestingInterface(); |
50 } | 50 } |
51 | 51 |
52 void TestFlashFullscreen::RunTests(const std::string& filter) { | 52 void TestFlashFullscreen::RunTests(const std::string& filter) { |
53 RUN_TEST(GetScreenSize, filter); | 53 RUN_TEST(GetScreenSize, filter); |
54 RUN_TEST(NormalToFullscreenToNormal, filter); | 54 RUN_TEST(NormalToFullscreenToNormal, filter); |
55 } | 55 } |
56 | 56 |
57 std::string TestFlashFullscreen::TestGetScreenSize() { | 57 std::string TestFlashFullscreen::TestGetScreenSize() { |
58 if (screen_size_.width() < 320 || screen_size_.width() > 2560) | 58 if (screen_size_.width() < 320 || screen_size_.width() > 2560) |
59 return ReportError("screen_size.width()", screen_size_.width()); | 59 return ReportError("screen_size.width()", screen_size_.width()); |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 if (fullscreen_pending_ && IsFullscreenView(position, clip, screen_size_)) { | 136 if (fullscreen_pending_ && IsFullscreenView(position, clip, screen_size_)) { |
137 fullscreen_pending_ = false; | 137 fullscreen_pending_ = false; |
138 pp::Module::Get()->core()->CallOnMainThread(0, fullscreen_callback_); | 138 pp::Module::Get()->core()->CallOnMainThread(0, fullscreen_callback_); |
139 } else if (normal_pending_ && | 139 } else if (normal_pending_ && |
140 !IsFullscreenView(position, clip, screen_size_)) { | 140 !IsFullscreenView(position, clip, screen_size_)) { |
141 normal_pending_ = false; | 141 normal_pending_ = false; |
142 if (testing_interface_->IsOutOfProcess()) | 142 if (testing_interface_->IsOutOfProcess()) |
143 pp::Module::Get()->core()->CallOnMainThread(0, normal_callback_); | 143 pp::Module::Get()->core()->CallOnMainThread(0, normal_callback_); |
144 } | 144 } |
145 } | 145 } |
OLD | NEW |