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_view.h" | 5 #include "ppapi/tests/test_view.h" |
6 | 6 |
7 #include <sstream> | 7 #include <sstream> |
8 | 8 |
9 #include "ppapi/c/pp_time.h" | 9 #include "ppapi/c/pp_time.h" |
10 #include "ppapi/c/private/ppb_testing_private.h" | 10 #include "ppapi/c/private/ppb_testing_private.h" |
11 #include "ppapi/cpp/completion_callback.h" | 11 #include "ppapi/cpp/completion_callback.h" |
12 #include "ppapi/tests/testing_instance.h" | 12 #include "ppapi/tests/testing_instance.h" |
13 | 13 |
14 REGISTER_TEST_CASE(View); | 14 REGISTER_TEST_CASE(View); |
15 | 15 |
16 // When waiting for view changed events, wait no longer than this. | 16 // When waiting for view changed events, wait no longer than this. |
17 #if !defined(THREAD_SANITIZER) | 17 #if !defined(THREAD_SANITIZER) && !defined(MEMORY_SANITIZER) |
18 static int kViewChangeTimeoutSec = 5; | 18 static int kViewChangeTimeoutSec = 5; |
19 #else | 19 #else |
20 // ThreadSanitizer may slow the interaction down significantly. | 20 // ThreadSanitizer may slow the interaction down significantly. |
21 static int kViewChangeTimeoutSec = 30; | 21 static int kViewChangeTimeoutSec = 30; |
22 #endif | 22 #endif |
23 | 23 |
24 TestView::TestView(TestingInstance* instance) | 24 TestView::TestView(TestingInstance* instance) |
25 : TestCase(instance), | 25 : TestCase(instance), |
26 post_quit_on_view_changed_(false) { | 26 post_quit_on_view_changed_(false) { |
27 } | 27 } |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 begin_time = pp::Module::Get()->core()->GetTime(); | 219 begin_time = pp::Module::Get()->core()->GetTime(); |
220 while (WaitUntilViewChanged() && | 220 while (WaitUntilViewChanged() && |
221 last_view_.GetScrollOffset() != pp::Point(0, 0) && | 221 last_view_.GetScrollOffset() != pp::Point(0, 0) && |
222 pp::Module::Get()->core()->GetTime() - begin_time < | 222 pp::Module::Get()->core()->GetTime() - begin_time < |
223 kViewChangeTimeoutSec) { | 223 kViewChangeTimeoutSec) { |
224 } | 224 } |
225 ASSERT_EQ(pp::Point(0, 0), last_view_.GetScrollOffset()); | 225 ASSERT_EQ(pp::Point(0, 0), last_view_.GetScrollOffset()); |
226 | 226 |
227 PASS(); | 227 PASS(); |
228 } | 228 } |
OLD | NEW |