| 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/command_line.h" | 5 #include "base/command_line.h" |
| 6 #include "base/memory/scoped_ptr.h" | 6 #include "base/memory/scoped_ptr.h" |
| 7 #include "base/run_loop.h" | 7 #include "base/run_loop.h" |
| 8 #include "chrome/browser/printing/print_preview_dialog_controller.h" | 8 #include "chrome/browser/printing/print_preview_dialog_controller.h" |
| 9 #include "chrome/browser/ui/browser.h" | 9 #include "chrome/browser/ui/browser.h" |
| 10 #include "chrome/browser/ui/browser_commands.h" | 10 #include "chrome/browser/ui/browser_commands.h" |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 // Get the preview dialog for the initiator tab. | 173 // Get the preview dialog for the initiator tab. |
| 174 WebContents* preview_dialog = GetPrintPreviewDialog(); | 174 WebContents* preview_dialog = GetPrintPreviewDialog(); |
| 175 | 175 |
| 176 // Check a new print preview dialog got created. | 176 // Check a new print preview dialog got created. |
| 177 ASSERT_TRUE(preview_dialog); | 177 ASSERT_TRUE(preview_dialog); |
| 178 ASSERT_NE(initiator(), preview_dialog); | 178 ASSERT_NE(initiator(), preview_dialog); |
| 179 | 179 |
| 180 // Navigate in the initiator tab. Make sure navigating destroys the print | 180 // Navigate in the initiator tab. Make sure navigating destroys the print |
| 181 // preview dialog. | 181 // preview dialog. |
| 182 PrintPreviewDialogDestroyedObserver dialog_destroyed_observer(preview_dialog); | 182 PrintPreviewDialogDestroyedObserver dialog_destroyed_observer(preview_dialog); |
| 183 ui_test_utils::NavigateToURL(browser(), GURL(chrome::kChromeUINewTabURL)); | 183 ui_test_utils::NavigateToURL(browser(), GURL(chrome::kChromeUIOmniboxURL)); |
| 184 ASSERT_TRUE(dialog_destroyed_observer.dialog_destroyed()); | 184 ASSERT_TRUE(dialog_destroyed_observer.dialog_destroyed()); |
| 185 | 185 |
| 186 // Try printing again. | 186 // Try printing again. |
| 187 PrintPreview(); | 187 PrintPreview(); |
| 188 | 188 |
| 189 // Get the print preview dialog for the initiator tab. | 189 // Get the print preview dialog for the initiator tab. |
| 190 WebContents* new_preview_dialog = GetPrintPreviewDialog(); | 190 WebContents* new_preview_dialog = GetPrintPreviewDialog(); |
| 191 | 191 |
| 192 // Check a new preview dialog got created. | 192 // Check a new preview dialog got created. |
| 193 EXPECT_TRUE(new_preview_dialog); | 193 EXPECT_TRUE(new_preview_dialog); |
| (...skipping 22 matching lines...) Expand all Loading... |
| 216 notification_observer.Wait(); | 216 notification_observer.Wait(); |
| 217 ASSERT_TRUE(dialog_destroyed_observer.dialog_destroyed()); | 217 ASSERT_TRUE(dialog_destroyed_observer.dialog_destroyed()); |
| 218 | 218 |
| 219 // Try printing again. | 219 // Try printing again. |
| 220 PrintPreview(); | 220 PrintPreview(); |
| 221 | 221 |
| 222 // Create a preview dialog for the initiator tab. | 222 // Create a preview dialog for the initiator tab. |
| 223 WebContents* new_preview_dialog = GetPrintPreviewDialog(); | 223 WebContents* new_preview_dialog = GetPrintPreviewDialog(); |
| 224 EXPECT_TRUE(new_preview_dialog); | 224 EXPECT_TRUE(new_preview_dialog); |
| 225 } | 225 } |
| OLD | NEW |