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_clipboard.h" | 5 #include "ppapi/tests/test_flash_clipboard.h" |
6 | 6 |
7 #include "ppapi/cpp/instance.h" | 7 #include "ppapi/cpp/instance.h" |
8 #include "ppapi/cpp/module.h" | 8 #include "ppapi/cpp/module.h" |
9 #include "ppapi/cpp/point.h" | 9 #include "ppapi/cpp/point.h" |
10 #include "ppapi/tests/testing_instance.h" | 10 #include "ppapi/tests/testing_instance.h" |
11 | 11 |
12 REGISTER_TEST_CASE(FlashClipboard); | 12 REGISTER_TEST_CASE(FlashClipboard); |
13 | 13 |
14 TestFlashClipboard::TestFlashClipboard(TestingInstance* instance) | 14 TestFlashClipboard::TestFlashClipboard(TestingInstance* instance) |
15 : TestCase(instance), | 15 : TestCase(instance), |
16 clipboard_interface_(NULL) { | 16 clipboard_interface_(NULL) { |
17 } | 17 } |
18 | 18 |
19 bool TestFlashClipboard::Init() { | 19 bool TestFlashClipboard::Init() { |
20 clipboard_interface_ = static_cast<const PPB_Flash_Clipboard*>( | 20 clipboard_interface_ = static_cast<const PPB_Flash_Clipboard_3_0*>( |
21 pp::Module::Get()->GetBrowserInterface(PPB_FLASH_CLIPBOARD_INTERFACE)); | 21 pp::Module::Get()->GetBrowserInterface( |
| 22 PPB_FLASH_CLIPBOARD_INTERFACE_3_0)); |
22 return !!clipboard_interface_; | 23 return !!clipboard_interface_; |
23 } | 24 } |
24 | 25 |
25 void TestFlashClipboard::RunTests(const std::string& filter) { | 26 void TestFlashClipboard::RunTests(const std::string& filter) { |
26 RUN_TEST(ReadWrite, filter); | 27 RUN_TEST(ReadWrite, filter); |
27 } | 28 } |
28 | 29 |
29 std::string TestFlashClipboard::TestReadWrite() { | 30 std::string TestFlashClipboard::TestReadWrite() { |
30 std::string input_str("Hello, world"); | 31 std::string input_str("Hello, world"); |
31 pp::Var input_var(input_str); | 32 pp::Var input_var(input_str); |
(...skipping 29 matching lines...) Expand all Loading... |
61 result_str = result_var.AsString(); | 62 result_str = result_var.AsString(); |
62 if (result_str == input_str) | 63 if (result_str == input_str) |
63 break; | 64 break; |
64 | 65 |
65 PlatformSleep(kIntervalMs); | 66 PlatformSleep(kIntervalMs); |
66 } | 67 } |
67 | 68 |
68 ASSERT_TRUE(result_str == input_str); | 69 ASSERT_TRUE(result_str == input_str); |
69 PASS(); | 70 PASS(); |
70 } | 71 } |
OLD | NEW |