| 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/files/file.h" | 6 #include "base/files/file.h" |
| 7 #include "base/files/file_enumerator.h" | 7 #include "base/files/file_enumerator.h" |
| 8 #include "base/hash.h" | 8 #include "base/hash.h" |
| 9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
| 10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
| 11 #include "base/strings/string_util.h" | 11 #include "base/strings/string_util.h" |
| 12 #include "base/strings/utf_string_conversions.h" | 12 #include "base/strings/utf_string_conversions.h" |
| 13 #include "chrome/browser/chrome_notification_types.h" | 13 #include "chrome/browser/chrome_notification_types.h" |
| 14 #include "chrome/browser/ui/browser.h" | 14 #include "chrome/browser/ui/browser.h" |
| 15 #include "chrome/browser/ui/browser_window.h" | 15 #include "chrome/browser/ui/browser_window.h" |
| 16 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 16 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 17 #include "chrome/common/chrome_paths.h" | 17 #include "chrome/common/chrome_paths.h" |
| 18 #include "chrome/test/base/in_process_browser_test.h" | 18 #include "chrome/test/base/in_process_browser_test.h" |
| 19 #include "chrome/test/base/ui_test_utils.h" | 19 #include "chrome/test/base/ui_test_utils.h" |
| 20 #include "content/public/browser/navigation_controller.h" | 20 #include "content/public/browser/navigation_controller.h" |
| 21 #include "content/public/browser/notification_observer.h" | 21 #include "content/public/browser/notification_observer.h" |
| 22 #include "content/public/browser/render_frame_host.h" |
| 22 #include "content/public/browser/render_view_host.h" | 23 #include "content/public/browser/render_view_host.h" |
| 23 #include "content/public/browser/web_contents.h" | 24 #include "content/public/browser/web_contents.h" |
| 24 #include "content/public/test/browser_test_utils.h" | 25 #include "content/public/test/browser_test_utils.h" |
| 25 #include "net/test/embedded_test_server/embedded_test_server.h" | 26 #include "net/test/embedded_test_server/embedded_test_server.h" |
| 26 #include "third_party/skia/include/core/SkBitmap.h" | 27 #include "third_party/skia/include/core/SkBitmap.h" |
| 27 #include "ui/base/clipboard/clipboard.h" | 28 #include "ui/base/clipboard/clipboard.h" |
| 28 #include "ui/gfx/codec/png_codec.h" | 29 #include "ui/gfx/codec/png_codec.h" |
| 29 #include "ui/gfx/screen.h" | 30 #include "ui/gfx/screen.h" |
| 30 | 31 |
| 31 using content::NavigationController; | 32 using content::NavigationController; |
| (...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 284 // Verify that copying selected text works. | 285 // Verify that copying selected text works. |
| 285 ui::Clipboard* clipboard = ui::Clipboard::GetForCurrentThread(); | 286 ui::Clipboard* clipboard = ui::Clipboard::GetForCurrentThread(); |
| 286 // Reset the clipboard first. | 287 // Reset the clipboard first. |
| 287 ui::Clipboard::ObjectMap objects; | 288 ui::Clipboard::ObjectMap objects; |
| 288 ui::Clipboard::ObjectMapParams params; | 289 ui::Clipboard::ObjectMapParams params; |
| 289 params.push_back(std::vector<char>()); | 290 params.push_back(std::vector<char>()); |
| 290 objects[ui::Clipboard::CBF_TEXT] = params; | 291 objects[ui::Clipboard::CBF_TEXT] = params; |
| 291 clipboard->WriteObjects(ui::CLIPBOARD_TYPE_COPY_PASTE, objects); | 292 clipboard->WriteObjects(ui::CLIPBOARD_TYPE_COPY_PASTE, objects); |
| 292 | 293 |
| 293 browser()->tab_strip_model()->GetActiveWebContents()-> | 294 browser()->tab_strip_model()->GetActiveWebContents()-> |
| 294 GetRenderViewHost()->Copy(); | 295 GetMainFrame()->Copy(); |
| 295 ASSERT_NO_FATAL_FAILURE(WaitForResponse()); | 296 ASSERT_NO_FATAL_FAILURE(WaitForResponse()); |
| 296 | 297 |
| 297 std::string text; | 298 std::string text; |
| 298 clipboard->ReadAsciiText(ui::CLIPBOARD_TYPE_COPY_PASTE, &text); | 299 clipboard->ReadAsciiText(ui::CLIPBOARD_TYPE_COPY_PASTE, &text); |
| 299 ASSERT_EQ("adipiscing", text); | 300 ASSERT_EQ("adipiscing", text); |
| 300 } | 301 } |
| 301 | 302 |
| 302 const int kLoadingNumberOfParts = 10; | 303 const int kLoadingNumberOfParts = 10; |
| 303 | 304 |
| 304 // Tests that loading async pdfs works correctly (i.e. document fully loads). | 305 // Tests that loading async pdfs works correctly (i.e. document fully loads). |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 424 browser()->tab_strip_model()->GetActiveWebContents(), | 425 browser()->tab_strip_model()->GetActiveWebContents(), |
| 425 "reloadPDF();")); | 426 "reloadPDF();")); |
| 426 observer.Wait(); | 427 observer.Wait(); |
| 427 | 428 |
| 428 ASSERT_EQ("success", | 429 ASSERT_EQ("success", |
| 429 browser()->tab_strip_model()->GetActiveWebContents()-> | 430 browser()->tab_strip_model()->GetActiveWebContents()-> |
| 430 GetURL().query()); | 431 GetURL().query()); |
| 431 } | 432 } |
| 432 | 433 |
| 433 } // namespace | 434 } // namespace |
| OLD | NEW |