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

Side by Side Diff: chrome/browser/ui/webui/constrained_web_dialog_ui_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/strings/utf_string_conversions.h" 5 #include "base/strings/utf_string_conversions.h"
6 #include "chrome/browser/profiles/profile.h" 6 #include "chrome/browser/profiles/profile.h"
7 #include "chrome/browser/ui/browser.h" 7 #include "chrome/browser/ui/browser.h"
8 #include "chrome/browser/ui/tabs/tab_strip_model.h" 8 #include "chrome/browser/ui/tabs/tab_strip_model.h"
9 #include "chrome/browser/ui/webui/constrained_web_dialog_ui.h" 9 #include "chrome/browser/ui/webui/constrained_web_dialog_ui.h"
10 #include "chrome/common/url_constants.h" 10 #include "chrome/common/url_constants.h"
(...skipping 15 matching lines...) Expand all
26 public: 26 public:
27 explicit ConstrainedWebDialogBrowserTestObserver(WebContents* contents) 27 explicit ConstrainedWebDialogBrowserTestObserver(WebContents* contents)
28 : content::WebContentsObserver(contents), 28 : content::WebContentsObserver(contents),
29 contents_destroyed_(false) { 29 contents_destroyed_(false) {
30 } 30 }
31 virtual ~ConstrainedWebDialogBrowserTestObserver() {} 31 virtual ~ConstrainedWebDialogBrowserTestObserver() {}
32 32
33 bool contents_destroyed() { return contents_destroyed_; } 33 bool contents_destroyed() { return contents_destroyed_; }
34 34
35 private: 35 private:
36 virtual void WebContentsDestroyed(WebContents* tab) OVERRIDE { 36 virtual void WebContentsDestroyed() OVERRIDE {
37 contents_destroyed_ = true; 37 contents_destroyed_ = true;
38 } 38 }
39 39
40 bool contents_destroyed_; 40 bool contents_destroyed_;
41 }; 41 };
42 42
43 } // namespace 43 } // namespace
44 44
45 class ConstrainedWebDialogBrowserTest : public InProcessBrowserTest { 45 class ConstrainedWebDialogBrowserTest : public InProcessBrowserTest {
46 public: 46 public:
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 95
96 ConstrainedWebDialogBrowserTestObserver observer(new_tab.get()); 96 ConstrainedWebDialogBrowserTestObserver observer(new_tab.get());
97 dialog_delegate->ReleaseWebContentsOnDialogClose(); 97 dialog_delegate->ReleaseWebContentsOnDialogClose();
98 dialog_delegate->OnDialogCloseFromWebUI(); 98 dialog_delegate->OnDialogCloseFromWebUI();
99 99
100 ASSERT_FALSE(observer.contents_destroyed()); 100 ASSERT_FALSE(observer.contents_destroyed());
101 EXPECT_FALSE(IsShowingWebContentsModalDialog(web_contents)); 101 EXPECT_FALSE(IsShowingWebContentsModalDialog(web_contents));
102 new_tab.reset(); 102 new_tab.reset();
103 EXPECT_TRUE(observer.contents_destroyed()); 103 EXPECT_TRUE(observer.contents_destroyed());
104 } 104 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698