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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
352 ASSERT_TRUE(ui_test_utils::ExecuteJavaScript( | 352 ASSERT_TRUE(ui_test_utils::ExecuteJavaScript( |
353 browser()->GetSelectedWebContents()->GetRenderViewHost(), | 353 browser()->GetSelectedWebContents()->GetRenderViewHost(), |
354 std::wstring(), | 354 std::wstring(), |
355 L"reloadPDF();")); | 355 L"reloadPDF();")); |
356 observer.Wait(); | 356 observer.Wait(); |
357 | 357 |
358 ASSERT_EQ("success", browser()->GetSelectedWebContents()->GetURL().query()); | 358 ASSERT_EQ("success", browser()->GetSelectedWebContents()->GetURL().query()); |
359 } | 359 } |
360 | 360 |
361 } // namespace | 361 } // namespace |
OLD | NEW |