| 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 <vector> | 5 #include <vector> |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/memory/ref_counted_memory.h" | 8 #include "base/memory/ref_counted_memory.h" |
| 9 #include "chrome/browser/printing/print_preview_tab_controller.h" | 9 #include "chrome/browser/printing/print_preview_tab_controller.h" |
| 10 #include "chrome/browser/ui/browser_list.h" | 10 #include "chrome/browser/ui/browser_list.h" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 ASSERT_TRUE(browser()); | 43 ASSERT_TRUE(browser()); |
| 44 BrowserList::SetLastActive(browser()); | 44 BrowserList::SetLastActive(browser()); |
| 45 ASSERT_TRUE(BrowserList::GetLastActive()); | 45 ASSERT_TRUE(BrowserList::GetLastActive()); |
| 46 | 46 |
| 47 browser()->NewTab(); | 47 browser()->NewTab(); |
| 48 TabContentsWrapper* initiator_tab = | 48 TabContentsWrapper* initiator_tab = |
| 49 browser()->GetSelectedTabContentsWrapper(); | 49 browser()->GetSelectedTabContentsWrapper(); |
| 50 ASSERT_TRUE(initiator_tab); | 50 ASSERT_TRUE(initiator_tab); |
| 51 EXPECT_EQ(0U, GetConstrainedWindowCount(initiator_tab)); | 51 EXPECT_EQ(0U, GetConstrainedWindowCount(initiator_tab)); |
| 52 | 52 |
| 53 scoped_refptr<printing::PrintPreviewTabController> | 53 printing::PrintPreviewTabController* controller = |
| 54 controller(new printing::PrintPreviewTabController()); | 54 printing::PrintPreviewTabController::GetInstance(); |
| 55 ASSERT_TRUE(controller); | 55 ASSERT_TRUE(controller); |
| 56 | 56 |
| 57 TabContentsWrapper* preview_tab = | 57 TabContentsWrapper* preview_tab = |
| 58 controller->GetOrCreatePreviewTab(initiator_tab); | 58 controller->GetOrCreatePreviewTab(initiator_tab); |
| 59 | 59 |
| 60 EXPECT_NE(initiator_tab, preview_tab); | 60 EXPECT_NE(initiator_tab, preview_tab); |
| 61 EXPECT_EQ(1, browser()->tab_count()); | 61 EXPECT_EQ(1, browser()->tab_count()); |
| 62 EXPECT_EQ(1U, GetConstrainedWindowCount(initiator_tab)); | 62 EXPECT_EQ(1U, GetConstrainedWindowCount(initiator_tab)); |
| 63 | 63 |
| 64 PrintPreviewUI* preview_ui = | 64 PrintPreviewUI* preview_ui = |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 cancel = false; | 232 cancel = false; |
| 233 preview_ui->GetCurrentPrintPreviewStatus(preview_ui_addr, kFirstRequestId, | 233 preview_ui->GetCurrentPrintPreviewStatus(preview_ui_addr, kFirstRequestId, |
| 234 &cancel); | 234 &cancel); |
| 235 EXPECT_TRUE(cancel); | 235 EXPECT_TRUE(cancel); |
| 236 | 236 |
| 237 cancel = true; | 237 cancel = true; |
| 238 preview_ui->GetCurrentPrintPreviewStatus(preview_ui_addr, kSecondRequestId, | 238 preview_ui->GetCurrentPrintPreviewStatus(preview_ui_addr, kSecondRequestId, |
| 239 &cancel); | 239 &cancel); |
| 240 EXPECT_FALSE(cancel); | 240 EXPECT_FALSE(cancel); |
| 241 } | 241 } |
| OLD | NEW |