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

Side by Side Diff: chrome/browser/ui/cocoa/extensions/media_galleries_dialog_cocoa_browsertest.mm

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/strings/utf_string_conversions.h" 5 #include "base/strings/utf_string_conversions.h"
6 #include "chrome/browser/ui/cocoa/extensions/media_galleries_dialog_cocoa.h" 6 #include "chrome/browser/ui/cocoa/extensions/media_galleries_dialog_cocoa.h"
7 7
8 #include "chrome/browser/media_galleries/media_galleries_dialog_controller_mock. h" 8 #include "chrome/browser/media_galleries/media_galleries_dialog_controller_mock. h"
9 #include "chrome/browser/ui/browser.h" 9 #include "chrome/browser/ui/browser.h"
10 #include "chrome/browser/ui/cocoa/constrained_window/constrained_window_alert.h" 10 #include "chrome/browser/ui/cocoa/constrained_window/constrained_window_alert.h"
(...skipping 24 matching lines...) Expand all
35 std::vector<base::string16> headers; 35 std::vector<base::string16> headers;
36 headers.push_back(base::string16()); // The first section has no header. 36 headers.push_back(base::string16()); // The first section has no header.
37 headers.push_back(base::ASCIIToUTF16("header2")); 37 headers.push_back(base::ASCIIToUTF16("header2"));
38 ON_CALL(controller, GetSectionHeaders()). 38 ON_CALL(controller, GetSectionHeaders()).
39 WillByDefault(Return(headers)); 39 WillByDefault(Return(headers));
40 EXPECT_CALL(controller, GetAuxiliaryButtonText()). 40 EXPECT_CALL(controller, GetAuxiliaryButtonText()).
41 WillRepeatedly(Return(base::ASCIIToUTF16("button"))); 41 WillRepeatedly(Return(base::ASCIIToUTF16("button")));
42 EXPECT_CALL(controller, GetSectionEntries(_)). 42 EXPECT_CALL(controller, GetSectionEntries(_)).
43 Times(AnyNumber()); 43 Times(AnyNumber());
44 44
45 scoped_ptr<MediaGalleriesDialogCocoa> dialog( 45 std::unique_ptr<MediaGalleriesDialogCocoa> dialog(
46 static_cast<MediaGalleriesDialogCocoa*>( 46 static_cast<MediaGalleriesDialogCocoa*>(
47 MediaGalleriesDialog::Create(&controller))); 47 MediaGalleriesDialog::Create(&controller)));
48 base::scoped_nsobject<NSWindow> window([[dialog->alert_ window] retain]); 48 base::scoped_nsobject<NSWindow> window([[dialog->alert_ window] retain]);
49 EXPECT_TRUE([window isVisible]); 49 EXPECT_TRUE([window isVisible]);
50 50
51 web_modal::WebContentsModalDialogManager* manager = 51 web_modal::WebContentsModalDialogManager* manager =
52 web_modal::WebContentsModalDialogManager::FromWebContents(web_contents); 52 web_modal::WebContentsModalDialogManager::FromWebContents(web_contents);
53 web_modal::WebContentsModalDialogManager::TestApi(manager).CloseAllDialogs(); 53 web_modal::WebContentsModalDialogManager::TestApi(manager).CloseAllDialogs();
54 EXPECT_FALSE([window isVisible]); 54 EXPECT_FALSE([window isVisible]);
55 } 55 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698