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" |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 // RequestPrintPreviewObserver to get messages first for the purposes of | 132 // RequestPrintPreviewObserver to get messages first for the purposes of |
133 // this test. | 133 // this test. |
134 cloned_tab_observer_.reset(new PrintPreviewDialogClonedObserver(first_tab)); | 134 cloned_tab_observer_.reset(new PrintPreviewDialogClonedObserver(first_tab)); |
135 chrome::DuplicateTab(browser()); | 135 chrome::DuplicateTab(browser()); |
136 | 136 |
137 initiator_ = browser()->tab_strip_model()->GetActiveWebContents(); | 137 initiator_ = browser()->tab_strip_model()->GetActiveWebContents(); |
138 ASSERT_TRUE(initiator_); | 138 ASSERT_TRUE(initiator_); |
139 ASSERT_NE(first_tab, initiator_); | 139 ASSERT_NE(first_tab, initiator_); |
140 } | 140 } |
141 | 141 |
142 virtual void CleanUpOnMainThread() OVERRIDE { | 142 virtual void TearDownOnMainThread() OVERRIDE { |
143 cloned_tab_observer_.reset(); | 143 cloned_tab_observer_.reset(); |
144 initiator_ = NULL; | 144 initiator_ = NULL; |
145 } | 145 } |
146 | 146 |
147 RequestPrintPreviewObserver* request_preview_dialog_observer() { | 147 RequestPrintPreviewObserver* request_preview_dialog_observer() { |
148 return cloned_tab_observer_->request_preview_dialog_observer(); | 148 return cloned_tab_observer_->request_preview_dialog_observer(); |
149 } | 149 } |
150 | 150 |
151 scoped_ptr<PrintPreviewDialogClonedObserver> cloned_tab_observer_; | 151 scoped_ptr<PrintPreviewDialogClonedObserver> cloned_tab_observer_; |
152 WebContents* initiator_; | 152 WebContents* initiator_; |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 browser()->tab_strip_model()->GetActiveWebContents()); | 217 browser()->tab_strip_model()->GetActiveWebContents()); |
218 ASSERT_TRUE(dialog_destroyed_observer.dialog_destroyed()); | 218 ASSERT_TRUE(dialog_destroyed_observer.dialog_destroyed()); |
219 | 219 |
220 // Try printing again. | 220 // Try printing again. |
221 PrintPreview(); | 221 PrintPreview(); |
222 | 222 |
223 // Create a preview dialog for the initiator tab. | 223 // Create a preview dialog for the initiator tab. |
224 WebContents* new_preview_dialog = GetPrintPreviewDialog(); | 224 WebContents* new_preview_dialog = GetPrintPreviewDialog(); |
225 EXPECT_TRUE(new_preview_dialog); | 225 EXPECT_TRUE(new_preview_dialog); |
226 } | 226 } |
OLD | NEW |