| 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/memory/scoped_ptr.h" | 5 #include "base/memory/scoped_ptr.h" |
| 6 #include "base/run_loop.h" | 6 #include "base/run_loop.h" |
| 7 #include "chrome/browser/printing/print_preview_dialog_controller.h" | 7 #include "chrome/browser/printing/print_preview_dialog_controller.h" |
| 8 #include "chrome/browser/ui/browser.h" | 8 #include "chrome/browser/ui/browser.h" |
| 9 #include "chrome/browser/ui/browser_commands.h" | 9 #include "chrome/browser/ui/browser_commands.h" |
| 10 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 10 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 11 #include "chrome/common/print_messages.h" | |
| 12 #include "chrome/common/url_constants.h" | 11 #include "chrome/common/url_constants.h" |
| 13 #include "chrome/test/base/in_process_browser_test.h" | 12 #include "chrome/test/base/in_process_browser_test.h" |
| 14 #include "chrome/test/base/ui_test_utils.h" | 13 #include "chrome/test/base/ui_test_utils.h" |
| 14 #include "components/printing/common/print_messages.h" |
| 15 #include "content/public/browser/web_contents_observer.h" | 15 #include "content/public/browser/web_contents_observer.h" |
| 16 #include "content/public/test/browser_test_utils.h" | 16 #include "content/public/test/browser_test_utils.h" |
| 17 #include "ipc/ipc_message_macros.h" |
| 17 #include "url/gurl.h" | 18 #include "url/gurl.h" |
| 18 #include "ipc/ipc_message_macros.h" | |
| 19 | 19 |
| 20 using content::WebContents; | 20 using content::WebContents; |
| 21 using content::WebContentsObserver; | 21 using content::WebContentsObserver; |
| 22 | 22 |
| 23 class RequestPrintPreviewObserver : public WebContentsObserver { | 23 class RequestPrintPreviewObserver : public WebContentsObserver { |
| 24 public: | 24 public: |
| 25 explicit RequestPrintPreviewObserver(WebContents* dialog) | 25 explicit RequestPrintPreviewObserver(WebContents* dialog) |
| 26 : WebContentsObserver(dialog) { | 26 : WebContentsObserver(dialog) { |
| 27 } | 27 } |
| 28 ~RequestPrintPreviewObserver() override {} | 28 ~RequestPrintPreviewObserver() override {} |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 browser()->tab_strip_model()->GetActiveWebContents()); | 214 browser()->tab_strip_model()->GetActiveWebContents()); |
| 215 ASSERT_TRUE(dialog_destroyed_observer.dialog_destroyed()); | 215 ASSERT_TRUE(dialog_destroyed_observer.dialog_destroyed()); |
| 216 | 216 |
| 217 // Try printing again. | 217 // Try printing again. |
| 218 PrintPreview(); | 218 PrintPreview(); |
| 219 | 219 |
| 220 // Create a preview dialog for the initiator tab. | 220 // Create a preview dialog for the initiator tab. |
| 221 WebContents* new_preview_dialog = GetPrintPreviewDialog(); | 221 WebContents* new_preview_dialog = GetPrintPreviewDialog(); |
| 222 EXPECT_TRUE(new_preview_dialog); | 222 EXPECT_TRUE(new_preview_dialog); |
| 223 } | 223 } |
| OLD | NEW |