OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 | 47 |
48 PlatformSleep(kIntervalMs); | 48 PlatformSleep(kIntervalMs); |
49 } | 49 } |
50 return is_available; | 50 return is_available; |
51 } | 51 } |
52 | 52 |
53 std::string TestFlashClipboard::ReadStringVar( | 53 std::string TestFlashClipboard::ReadStringVar( |
54 PP_Flash_Clipboard_Format format) { | 54 PP_Flash_Clipboard_Format format) { |
55 std::string result_str; | 55 std::string result_str; |
56 pp::Var result_var( | 56 pp::Var result_var( |
57 pp::Var::PassRef(), | 57 pp::PASS_REF, |
58 clipboard_interface_->ReadData(instance_->pp_instance(), | 58 clipboard_interface_->ReadData(instance_->pp_instance(), |
59 PP_FLASH_CLIPBOARD_TYPE_STANDARD, | 59 PP_FLASH_CLIPBOARD_TYPE_STANDARD, |
60 format)); | 60 format)); |
61 if (result_var.is_string()) | 61 if (result_var.is_string()) |
62 result_str = result_var.AsString(); | 62 result_str = result_var.AsString(); |
63 return result_str; | 63 return result_str; |
64 } | 64 } |
65 | 65 |
66 int32_t TestFlashClipboard::WriteStringVar(PP_Flash_Clipboard_Format format, | 66 int32_t TestFlashClipboard::WriteStringVar(PP_Flash_Clipboard_Format format, |
67 const std::string& input) { | 67 const std::string& input) { |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 ASSERT_TRUE(success == PP_OK); | 135 ASSERT_TRUE(success == PP_OK); |
136 | 136 |
137 ASSERT_TRUE(IsFormatAvailable(PP_FLASH_CLIPBOARD_FORMAT_PLAINTEXT)); | 137 ASSERT_TRUE(IsFormatAvailable(PP_FLASH_CLIPBOARD_FORMAT_PLAINTEXT)); |
138 ASSERT_TRUE(IsFormatAvailable(PP_FLASH_CLIPBOARD_FORMAT_HTML)); | 138 ASSERT_TRUE(IsFormatAvailable(PP_FLASH_CLIPBOARD_FORMAT_HTML)); |
139 | 139 |
140 ASSERT_TRUE(ReadAndMatchPlainText(plain_text_var.AsString())); | 140 ASSERT_TRUE(ReadAndMatchPlainText(plain_text_var.AsString())); |
141 ASSERT_TRUE(ReadAndMatchHTML(html_var.AsString())); | 141 ASSERT_TRUE(ReadAndMatchHTML(html_var.AsString())); |
142 | 142 |
143 PASS(); | 143 PASS(); |
144 } | 144 } |
OLD | NEW |