Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3057)

Unified Diff: chrome/browser/ui/webui/print_preview_ui_html_source_unittest.cc

Issue 7063030: PrintPreview: Print Preview is not staying associated with initiator renderer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: '' Created 9 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/webui/print_preview_ui_html_source_unittest.cc
diff --git a/chrome/browser/ui/webui/print_preview_ui_html_source_unittest.cc b/chrome/browser/ui/webui/print_preview_ui_html_source_unittest.cc
deleted file mode 100644
index 5653bc26497ebc2d4cd6ba74f2cbf63a169b9994..0000000000000000000000000000000000000000
--- a/chrome/browser/ui/webui/print_preview_ui_html_source_unittest.cc
+++ /dev/null
@@ -1,60 +0,0 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "base/command_line.h"
-#include "base/shared_memory.h"
-#include "chrome/browser/printing/print_preview_tab_controller.h"
-#include "chrome/browser/ui/browser_list.h"
-#include "chrome/browser/ui/webui/print_preview_ui.h"
-#include "chrome/browser/ui/webui/print_preview_ui_html_source.h"
-#include "chrome/common/chrome_switches.h"
-#include "chrome/test/browser_with_test_window_test.h"
-#include "chrome/test/testing_profile.h"
-#include "content/browser/tab_contents/tab_contents.h"
-
-typedef BrowserWithTestWindowTest PrintPreviewUIHTMLSourceTest;
-
-// Create/Get a preview tab for initiator tab.
-TEST_F(PrintPreviewUIHTMLSourceTest, PrintPreviewData) {
-#if !defined(GOOGLE_CHROME_BUILD) || defined(OS_CHROMEOS)
- CommandLine::ForCurrentProcess()->AppendSwitch(switches::kEnablePrintPreview);
-#endif
- ASSERT_TRUE(browser());
- BrowserList::SetLastActive(browser());
- ASSERT_TRUE(BrowserList::GetLastActive());
-
- browser()->NewTab();
- TabContents* initiator_tab = browser()->GetSelectedTabContents();
- ASSERT_TRUE(initiator_tab);
-
- scoped_refptr<printing::PrintPreviewTabController>
- controller(new printing::PrintPreviewTabController());
- ASSERT_TRUE(controller);
-
- TabContents* preview_tab = controller->GetOrCreatePreviewTab(initiator_tab);
-
- EXPECT_NE(initiator_tab, preview_tab);
- EXPECT_EQ(2, browser()->tab_count());
-
- PrintPreviewUI* preview_ui =
- reinterpret_cast<PrintPreviewUI*>(preview_tab->web_ui());
- ASSERT_TRUE(preview_ui != NULL);
- PrintPreviewUIHTMLSource* html_source = preview_ui->html_source();
-
- PrintPreviewUIHTMLSource::PrintPreviewData data;
- html_source->GetPrintPreviewData(&data);
- EXPECT_EQ(NULL, data.first);
- EXPECT_EQ(0U, data.second);
-
- PrintPreviewUIHTMLSource::PrintPreviewData dummy_data =
- std::make_pair(new base::SharedMemory(), 1234);
-
- html_source->SetPrintPreviewData(dummy_data);
- html_source->GetPrintPreviewData(&data);
- EXPECT_EQ(dummy_data, data);
-
- // This should not cause any memory leaks.
- dummy_data.first = new base::SharedMemory();
- html_source->SetPrintPreviewData(dummy_data);
-}
« no previous file with comments | « chrome/browser/ui/webui/print_preview_ui_html_source.cc ('k') | chrome/browser/ui/webui/print_preview_ui_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698