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_fullscreen.h" | 5 #include "ppapi/tests/test_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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 normal_callback_(instance->pp_instance()) { | 43 normal_callback_(instance->pp_instance()) { |
44 screen_mode_.GetScreenSize(&screen_size_); | 44 screen_mode_.GetScreenSize(&screen_size_); |
45 } | 45 } |
46 | 46 |
47 bool TestFullscreen::Init() { | 47 bool TestFullscreen::Init() { |
48 if (graphics2d_fullscreen_.is_null() && graphics2d_normal_.is_null()) | 48 if (graphics2d_fullscreen_.is_null() && graphics2d_normal_.is_null()) |
49 return false; | 49 return false; |
50 return InitTestingInterface(); | 50 return InitTestingInterface(); |
51 } | 51 } |
52 | 52 |
53 void TestFullscreen::RunTest() { | 53 void TestFullscreen::RunTests(const std::string& filter) { |
54 RUN_TEST(GetScreenSize); | 54 RUN_TEST(GetScreenSize, filter); |
55 RUN_TEST(NormalToFullscreenToNormal); | 55 RUN_TEST(NormalToFullscreenToNormal, filter); |
56 } | 56 } |
57 | 57 |
58 bool TestFullscreen::GotError() { | 58 bool TestFullscreen::GotError() { |
59 return !error_.empty(); | 59 return !error_.empty(); |
60 } | 60 } |
61 | 61 |
62 std::string TestFullscreen::Error() { | 62 std::string TestFullscreen::Error() { |
63 std::string last_error = error_; | 63 std::string last_error = error_; |
64 error_.clear(); | 64 error_.clear(); |
65 return last_error; | 65 return last_error; |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 pp::Module::Get()->core()->CallOnMainThread(0, fullscreen_callback_); | 217 pp::Module::Get()->core()->CallOnMainThread(0, fullscreen_callback_); |
218 } else if (normal_pending_) { | 218 } else if (normal_pending_) { |
219 normal_pending_ = false; | 219 normal_pending_ = false; |
220 if (screen_mode_.IsFullscreen()) | 220 if (screen_mode_.IsFullscreen()) |
221 error_ = "DidChangeview is in fullscreen"; | 221 error_ = "DidChangeview is in fullscreen"; |
222 else if (position != normal_position_) | 222 else if (position != normal_position_) |
223 error_ = "DidChangeView position is not normal"; | 223 error_ = "DidChangeView position is not normal"; |
224 pp::Module::Get()->core()->CallOnMainThread(0, normal_callback_); | 224 pp::Module::Get()->core()->CallOnMainThread(0, normal_callback_); |
225 } | 225 } |
226 } | 226 } |
OLD | NEW |