| 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 <vector> | 5 #include <vector> |
| 6 | 6 |
| 7 #include "base/memory/ref_counted_memory.h" | 7 #include "base/memory/ref_counted_memory.h" |
| 8 #include "chrome/browser/printing/print_preview_tab_controller.h" | 8 #include "chrome/browser/printing/print_preview_tab_controller.h" |
| 9 #include "chrome/browser/printing/print_preview_unit_test_base.h" | 9 #include "chrome/browser/printing/print_preview_unit_test_base.h" |
| 10 #include "chrome/browser/printing/print_view_manager.h" | 10 #include "chrome/browser/printing/print_view_manager.h" |
| 11 #include "chrome/browser/ui/browser_list.h" | 11 #include "chrome/browser/ui/browser_list.h" |
| 12 #include "chrome/browser/ui/constrained_window_tab_helper.h" | 12 #include "chrome/browser/ui/constrained_window_tab_helper.h" |
| 13 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 13 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
| 14 #include "chrome/browser/ui/webui/print_preview/print_preview_ui.h" | 14 #include "chrome/browser/ui/webui/print_preview/print_preview_ui.h" |
| 15 #include "content/public/browser/site_instance.h" | 15 #include "content/public/browser/site_instance.h" |
| 16 #include "content/public/browser/web_contents.h" | 16 #include "content/public/browser/web_contents.h" |
| 17 #include "content/test/web_contents_tester.h" | 17 #include "content/public/test/web_contents_tester.h" |
| 18 #include "printing/print_job_constants.h" | 18 #include "printing/print_job_constants.h" |
| 19 | 19 |
| 20 using content::WebContents; | 20 using content::WebContents; |
| 21 using content::WebContentsTester; | 21 using content::WebContentsTester; |
| 22 | 22 |
| 23 namespace { | 23 namespace { |
| 24 | 24 |
| 25 const unsigned char blob1[] = | 25 const unsigned char blob1[] = |
| 26 "12346102356120394751634516591348710478123649165419234519234512349134"; | 26 "12346102356120394751634516591348710478123649165419234519234512349134"; |
| 27 | 27 |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 PrintPreviewUI* preview_ui = static_cast<PrintPreviewUI*>( | 250 PrintPreviewUI* preview_ui = static_cast<PrintPreviewUI*>( |
| 251 preview_tab->web_contents()->GetWebUI()->GetController()); | 251 preview_tab->web_contents()->GetWebUI()->GetController()); |
| 252 ASSERT_TRUE(preview_ui != NULL); | 252 ASSERT_TRUE(preview_ui != NULL); |
| 253 | 253 |
| 254 preview_ui->OnPrintPreviewTabClosed(); | 254 preview_ui->OnPrintPreviewTabClosed(); |
| 255 | 255 |
| 256 EXPECT_EQ(2, browser()->tab_count()); | 256 EXPECT_EQ(2, browser()->tab_count()); |
| 257 EXPECT_EQ(0U, GetConstrainedWindowCount(initiator_tab)); | 257 EXPECT_EQ(0U, GetConstrainedWindowCount(initiator_tab)); |
| 258 EXPECT_EQ(1, initiator_tester->GetNumberOfFocusCalls()); | 258 EXPECT_EQ(1, initiator_tester->GetNumberOfFocusCalls()); |
| 259 } | 259 } |
| OLD | NEW |