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

Side by Side Diff: chrome/browser/ui/webui/constrained_web_dialog_ui_browsertest.cc

Issue 1865213004: Convert //chrome/browser/ui from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 8 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/callback.h" 5 #include "base/callback.h"
6 #include "base/location.h" 6 #include "base/location.h"
7 #include "base/strings/stringprintf.h" 7 #include "base/strings/stringprintf.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "build/build_config.h" 9 #include "build/build_config.h"
10 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 // The delegate deletes itself. 124 // The delegate deletes itself.
125 WebDialogDelegate* delegate = new ui::test::TestWebDialogDelegate( 125 WebDialogDelegate* delegate = new ui::test::TestWebDialogDelegate(
126 GURL(chrome::kChromeUIConstrainedHTMLTestURL)); 126 GURL(chrome::kChromeUIConstrainedHTMLTestURL));
127 WebContents* web_contents = 127 WebContents* web_contents =
128 browser()->tab_strip_model()->GetActiveWebContents(); 128 browser()->tab_strip_model()->GetActiveWebContents();
129 ASSERT_TRUE(web_contents); 129 ASSERT_TRUE(web_contents);
130 130
131 ConstrainedWebDialogDelegate* dialog_delegate = 131 ConstrainedWebDialogDelegate* dialog_delegate =
132 ShowConstrainedWebDialog(browser()->profile(), delegate, web_contents); 132 ShowConstrainedWebDialog(browser()->profile(), delegate, web_contents);
133 ASSERT_TRUE(dialog_delegate); 133 ASSERT_TRUE(dialog_delegate);
134 scoped_ptr<WebContents> new_tab(dialog_delegate->GetWebContents()); 134 std::unique_ptr<WebContents> new_tab(dialog_delegate->GetWebContents());
135 ASSERT_TRUE(new_tab.get()); 135 ASSERT_TRUE(new_tab.get());
136 ASSERT_TRUE(IsShowingWebContentsModalDialog(web_contents)); 136 ASSERT_TRUE(IsShowingWebContentsModalDialog(web_contents));
137 137
138 ConstrainedWebDialogBrowserTestObserver observer(new_tab.get()); 138 ConstrainedWebDialogBrowserTestObserver observer(new_tab.get());
139 dialog_delegate->ReleaseWebContentsOnDialogClose(); 139 dialog_delegate->ReleaseWebContentsOnDialogClose();
140 dialog_delegate->OnDialogCloseFromWebUI(); 140 dialog_delegate->OnDialogCloseFromWebUI();
141 141
142 ASSERT_FALSE(observer.contents_destroyed()); 142 ASSERT_FALSE(observer.contents_destroyed());
143 EXPECT_FALSE(IsShowingWebContentsModalDialog(web_contents)); 143 EXPECT_FALSE(IsShowingWebContentsModalDialog(web_contents));
144 new_tab.reset(); 144 new_tab.reset();
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 dialog_delegate))); 264 dialog_delegate)));
265 265
266 // Resize <body> to dimension larger than dialog. 266 // Resize <body> to dimension larger than dialog.
267 EXPECT_TRUE(ExecuteScript(dialog_delegate->GetWebContents(), 267 EXPECT_TRUE(ExecuteScript(dialog_delegate->GetWebContents(),
268 GetChangeDimensionsScript(500))); 268 GetChangeDimensionsScript(500)));
269 ASSERT_TRUE(RunLoopUntil(base::Bind( 269 ASSERT_TRUE(RunLoopUntil(base::Bind(
270 &IsEqualSizes, 270 &IsEqualSizes,
271 initial_dialog_size, 271 initial_dialog_size,
272 dialog_delegate))); 272 dialog_delegate)));
273 } 273 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/constrained_web_dialog_delegate_base.h ('k') | chrome/browser/ui/webui/cookies_tree_model_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698