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 "base/file_util.h" | 5 #include "base/file_util.h" |
6 #include "base/path_service.h" | 6 #include "base/path_service.h" |
7 #include "base/string_number_conversions.h" | 7 #include "base/string_number_conversions.h" |
8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
262 browser()->GetSelectedTabContentsWrapper(), UTF8ToUTF16("adipiscing"), | 262 browser()->GetSelectedTabContentsWrapper(), UTF8ToUTF16("adipiscing"), |
263 true, false, NULL)); | 263 true, false, NULL)); |
264 | 264 |
265 // Verify that copying selected text works. | 265 // Verify that copying selected text works. |
266 ui::Clipboard clipboard; | 266 ui::Clipboard clipboard; |
267 // Reset the clipboard first. | 267 // Reset the clipboard first. |
268 ui::Clipboard::ObjectMap objects; | 268 ui::Clipboard::ObjectMap objects; |
269 ui::Clipboard::ObjectMapParams params; | 269 ui::Clipboard::ObjectMapParams params; |
270 params.push_back(std::vector<char>()); | 270 params.push_back(std::vector<char>()); |
271 objects[ui::Clipboard::CBF_TEXT] = params; | 271 objects[ui::Clipboard::CBF_TEXT] = params; |
272 clipboard.WriteObjects(objects); | 272 clipboard.WriteObjects(ui::Clipboard::BUFFER_STANDARD, objects); |
273 | 273 |
274 browser()->GetSelectedWebContents()->GetRenderViewHost()->Copy(); | 274 browser()->GetSelectedWebContents()->GetRenderViewHost()->Copy(); |
275 ASSERT_NO_FATAL_FAILURE(WaitForResponse()); | 275 ASSERT_NO_FATAL_FAILURE(WaitForResponse()); |
276 | 276 |
277 std::string text; | 277 std::string text; |
278 clipboard.ReadAsciiText(ui::Clipboard::BUFFER_STANDARD, &text); | 278 clipboard.ReadAsciiText(ui::Clipboard::BUFFER_STANDARD, &text); |
279 ASSERT_EQ("adipiscing", text); | 279 ASSERT_EQ("adipiscing", text); |
280 } | 280 } |
281 | 281 |
282 // Tests that loading async pdfs works correctly (i.e. document fully loads). | 282 // Tests that loading async pdfs works correctly (i.e. document fully loads). |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
357 ASSERT_TRUE(ui_test_utils::ExecuteJavaScript( | 357 ASSERT_TRUE(ui_test_utils::ExecuteJavaScript( |
358 browser()->GetSelectedWebContents()->GetRenderViewHost(), | 358 browser()->GetSelectedWebContents()->GetRenderViewHost(), |
359 std::wstring(), | 359 std::wstring(), |
360 L"reloadPDF();")); | 360 L"reloadPDF();")); |
361 observer.Wait(); | 361 observer.Wait(); |
362 | 362 |
363 ASSERT_EQ("success", browser()->GetSelectedWebContents()->GetURL().query()); | 363 ASSERT_EQ("success", browser()->GetSelectedWebContents()->GetURL().query()); |
364 } | 364 } |
365 | 365 |
366 } // namespace | 366 } // namespace |
OLD | NEW |