| 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 "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
| 9 #include "chrome/browser/printing/print_preview_dialog_controller.h" | 9 #include "chrome/browser/printing/print_preview_dialog_controller.h" |
| 10 #include "chrome/browser/printing/print_preview_test.h" | 10 #include "chrome/browser/printing/print_preview_test.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 base::RefCountedBytes* CreateTestData() { | 29 base::RefCountedBytes* CreateTestData() { |
| 30 const unsigned char blob1[] = | 30 const unsigned char blob1[] = |
| 31 "12346102356120394751634516591348710478123649165419234519234512349134"; | 31 "12346102356120394751634516591348710478123649165419234519234512349134"; |
| 32 std::vector<unsigned char> preview_data(blob1, blob1 + sizeof(blob1)); | 32 std::vector<unsigned char> preview_data(blob1, blob1 + sizeof(blob1)); |
| 33 return new base::RefCountedBytes(preview_data); | 33 return new base::RefCountedBytes(preview_data); |
| 34 } | 34 } |
| 35 | 35 |
| 36 bool IsShowingWebContentsModalDialog(WebContents* tab) { | 36 bool IsShowingWebContentsModalDialog(WebContents* tab) { |
| 37 WebContentsModalDialogManager* web_contents_modal_dialog_manager = | 37 WebContentsModalDialogManager* web_contents_modal_dialog_manager = |
| 38 WebContentsModalDialogManager::FromWebContents(tab); | 38 WebContentsModalDialogManager::FromWebContents(tab); |
| 39 return web_contents_modal_dialog_manager->IsShowingDialog(); | 39 return web_contents_modal_dialog_manager->IsDialogActive(); |
| 40 } | 40 } |
| 41 | 41 |
| 42 } // namespace | 42 } // namespace |
| 43 | 43 |
| 44 class PrintPreviewUIUnitTest : public PrintPreviewTest { | 44 class PrintPreviewUIUnitTest : public PrintPreviewTest { |
| 45 public: | 45 public: |
| 46 PrintPreviewUIUnitTest(); | 46 PrintPreviewUIUnitTest(); |
| 47 virtual ~PrintPreviewUIUnitTest(); | 47 virtual ~PrintPreviewUIUnitTest(); |
| 48 | 48 |
| 49 protected: | 49 protected: |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 cancel = false; | 224 cancel = false; |
| 225 preview_ui->GetCurrentPrintPreviewStatus(preview_ui_addr, kFirstRequestId, | 225 preview_ui->GetCurrentPrintPreviewStatus(preview_ui_addr, kFirstRequestId, |
| 226 &cancel); | 226 &cancel); |
| 227 EXPECT_TRUE(cancel); | 227 EXPECT_TRUE(cancel); |
| 228 | 228 |
| 229 cancel = true; | 229 cancel = true; |
| 230 preview_ui->GetCurrentPrintPreviewStatus(preview_ui_addr, kSecondRequestId, | 230 preview_ui->GetCurrentPrintPreviewStatus(preview_ui_addr, kSecondRequestId, |
| 231 &cancel); | 231 &cancel); |
| 232 EXPECT_FALSE(cancel); | 232 EXPECT_FALSE(cancel); |
| 233 } | 233 } |
| OLD | NEW |