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

Side by Side Diff: chrome/browser/printing/print_preview_dialog_controller_browsertest.cc

Issue 257153003: We have a problem in the process on destroying WebContentsImpl because (Closed) Base URL: https://git.chromium.org/chromium/src.git@master
Patch Set: Rebased onto origin/master again, resolved conflicts Created 6 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 unified diff | Download patch
OLDNEW
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 "base/command_line.h" 5 #include "base/command_line.h"
6 #include "base/memory/scoped_ptr.h" 6 #include "base/memory/scoped_ptr.h"
7 #include "base/run_loop.h" 7 #include "base/run_loop.h"
8 #include "chrome/browser/printing/print_preview_dialog_controller.h" 8 #include "chrome/browser/printing/print_preview_dialog_controller.h"
9 #include "chrome/browser/ui/browser.h" 9 #include "chrome/browser/ui/browser.h"
10 #include "chrome/browser/ui/browser_commands.h" 10 #include "chrome/browser/ui/browser_commands.h"
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 explicit PrintPreviewDialogDestroyedObserver(WebContents* dialog) 84 explicit PrintPreviewDialogDestroyedObserver(WebContents* dialog)
85 : WebContentsObserver(dialog), 85 : WebContentsObserver(dialog),
86 dialog_destroyed_(false) { 86 dialog_destroyed_(false) {
87 } 87 }
88 virtual ~PrintPreviewDialogDestroyedObserver() {} 88 virtual ~PrintPreviewDialogDestroyedObserver() {}
89 89
90 bool dialog_destroyed() const { return dialog_destroyed_; } 90 bool dialog_destroyed() const { return dialog_destroyed_; }
91 91
92 private: 92 private:
93 // content::WebContentsObserver implementation. 93 // content::WebContentsObserver implementation.
94 virtual void WebContentsDestroyed(WebContents* contents) OVERRIDE { 94 virtual void WebContentsDestroyed() OVERRIDE {
95 dialog_destroyed_ = true; 95 dialog_destroyed_ = true;
96 } 96 }
97 97
98 bool dialog_destroyed_; 98 bool dialog_destroyed_;
99 99
100 DISALLOW_COPY_AND_ASSIGN(PrintPreviewDialogDestroyedObserver); 100 DISALLOW_COPY_AND_ASSIGN(PrintPreviewDialogDestroyedObserver);
101 }; 101 };
102 102
103 class PrintPreviewDialogControllerBrowserTest : public InProcessBrowserTest { 103 class PrintPreviewDialogControllerBrowserTest : public InProcessBrowserTest {
104 public: 104 public:
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 browser()->tab_strip_model()->GetActiveWebContents()); 213 browser()->tab_strip_model()->GetActiveWebContents());
214 ASSERT_TRUE(dialog_destroyed_observer.dialog_destroyed()); 214 ASSERT_TRUE(dialog_destroyed_observer.dialog_destroyed());
215 215
216 // Try printing again. 216 // Try printing again.
217 PrintPreview(); 217 PrintPreview();
218 218
219 // Create a preview dialog for the initiator tab. 219 // Create a preview dialog for the initiator tab.
220 WebContents* new_preview_dialog = GetPrintPreviewDialog(); 220 WebContents* new_preview_dialog = GetPrintPreviewDialog();
221 EXPECT_TRUE(new_preview_dialog); 221 EXPECT_TRUE(new_preview_dialog);
222 } 222 }
OLDNEW
« no previous file with comments | « chrome/browser/printing/print_dialog_cloud.cc ('k') | chrome/browser/safe_browsing/client_side_detection_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698