| 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 InitTestingInterface(); |
| 50 } | 50 } |
| 51 | 51 |
| 52 void TestFlashFullscreen::RunTest() { | 52 void TestFlashFullscreen::RunTests(const std::string& filter) { |
| 53 RUN_TEST(GetScreenSize); | 53 RUN_TEST(GetScreenSize, filter); |
| 54 RUN_TEST(NormalToFullscreenToNormal); | 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()); |
| 60 if (screen_size_.height() < 200 || screen_size_.height() > 2048) | 60 if (screen_size_.height() < 200 || screen_size_.height() > 2048) |
| 61 return ReportError("screen_size.height()", screen_size_.height()); | 61 return ReportError("screen_size.height()", screen_size_.height()); |
| 62 PASS(); | 62 PASS(); |
| 63 } | 63 } |
| 64 | 64 |
| (...skipping 71 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 |