OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/browser/printing/print_preview_tab_controller.h" | 5 #include "chrome/browser/printing/print_preview_tab_controller.h" |
6 #include "chrome/browser/tabs/tab_strip_model.h" | 6 #include "chrome/browser/tabs/tab_strip_model.h" |
7 #include "chrome/browser/ui/browser_list.h" | 7 #include "chrome/browser/ui/browser_list.h" |
8 #include "chrome/browser/ui/webui/print_preview_ui.h" | 8 #include "chrome/browser/ui/webui/print_preview_ui.h" |
9 #include "chrome/test/base/browser_with_test_window_test.h" | 9 #include "chrome/test/base/browser_with_test_window_test.h" |
10 #include "chrome/test/base/testing_profile.h" | 10 #include "chrome/test/base/testing_profile.h" |
11 #include "content/browser/tab_contents/navigation_entry.h" | 11 #include "content/browser/tab_contents/navigation_entry.h" |
12 #include "content/browser/tab_contents/navigation_details.h" | 12 #include "content/browser/tab_contents/navigation_details.h" |
13 #include "content/browser/tab_contents/tab_contents.h" | 13 #include "content/browser/tab_contents/tab_contents.h" |
| 14 #include "content/common/notification_service.h" |
14 #include "content/common/url_constants.h" | 15 #include "content/common/url_constants.h" |
15 | 16 |
16 typedef BrowserWithTestWindowTest PrintPreviewTabControllerUnitTest; | 17 typedef BrowserWithTestWindowTest PrintPreviewTabControllerUnitTest; |
17 | 18 |
18 // Create/Get a preview tab for initiator tab. | 19 // Create/Get a preview tab for initiator tab. |
19 TEST_F(PrintPreviewTabControllerUnitTest, GetOrCreatePreviewTab) { | 20 TEST_F(PrintPreviewTabControllerUnitTest, GetOrCreatePreviewTab) { |
20 ASSERT_TRUE(browser()); | 21 ASSERT_TRUE(browser()); |
21 BrowserList::SetLastActive(browser()); | 22 BrowserList::SetLastActive(browser()); |
22 ASSERT_TRUE(BrowserList::GetLastActive()); | 23 ASSERT_TRUE(BrowserList::GetLastActive()); |
23 | 24 |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 tab_controller->EraseInitiatorTabInfo(preview_tab); | 189 tab_controller->EraseInitiatorTabInfo(preview_tab); |
189 | 190 |
190 // Get the print preview tab for initiator tab. | 191 // Get the print preview tab for initiator tab. |
191 TabContents* new_preview_tab = | 192 TabContents* new_preview_tab = |
192 tab_controller->GetOrCreatePreviewTab(initiator_tab); | 193 tab_controller->GetOrCreatePreviewTab(initiator_tab); |
193 | 194 |
194 // New preview tab is created. | 195 // New preview tab is created. |
195 EXPECT_EQ(3, browser()->tab_count()); | 196 EXPECT_EQ(3, browser()->tab_count()); |
196 EXPECT_NE(new_preview_tab, preview_tab); | 197 EXPECT_NE(new_preview_tab, preview_tab); |
197 } | 198 } |
OLD | NEW |