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

Side by Side Diff: chrome/browser/ui/cocoa/panels/panel_cocoa_unittest.mm

Issue 17593006: mac: Update clients of scoped_nsobject.h. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: iwyu, scoped_nsprotocol Created 7 years, 6 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 | Annotate | Revision Log
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 <Carbon/Carbon.h> 5 #include <Carbon/Carbon.h>
6 #import <Cocoa/Cocoa.h> 6 #import <Cocoa/Cocoa.h>
7 7
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/debug/debugger.h" 9 #include "base/debug/debugger.h"
10 #include "base/mac/scoped_nsautorelease_pool.h" 10 #include "base/mac/scoped_nsautorelease_pool.h"
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
289 content::Source<Panel>(panel)); 289 content::Source<Panel>(panel));
290 [titlebar simulateCloseButtonClick]; 290 [titlebar simulateCloseButtonClick];
291 signal.Wait(); 291 signal.Wait();
292 EXPECT_EQ(0, manager->num_panels()); 292 EXPECT_EQ(0, manager->num_panels());
293 } 293 }
294 294
295 // Verify some menu items being properly enabled/disabled for panels. 295 // Verify some menu items being properly enabled/disabled for panels.
296 TEST_F(PanelCocoaTest, MenuItems) { 296 TEST_F(PanelCocoaTest, MenuItems) {
297 Panel* panel = CreateTestPanel("Test Panel"); 297 Panel* panel = CreateTestPanel("Test Panel");
298 298
299 scoped_nsobject<NSMenu> menu([[NSMenu alloc] initWithTitle:@""]); 299 base::scoped_nsobject<NSMenu> menu([[NSMenu alloc] initWithTitle:@""]);
300 NSMenuItem* close_tab_menu_item = CreateMenuItem(menu, IDC_CLOSE_TAB); 300 NSMenuItem* close_tab_menu_item = CreateMenuItem(menu, IDC_CLOSE_TAB);
301 NSMenuItem* new_tab_menu_item = CreateMenuItem(menu, IDC_NEW_TAB); 301 NSMenuItem* new_tab_menu_item = CreateMenuItem(menu, IDC_NEW_TAB);
302 NSMenuItem* new_tab_window_item = CreateMenuItem(menu, IDC_NEW_WINDOW); 302 NSMenuItem* new_tab_window_item = CreateMenuItem(menu, IDC_NEW_WINDOW);
303 NSMenuItem* new_tab_incognito_window_item = 303 NSMenuItem* new_tab_incognito_window_item =
304 CreateMenuItem(menu, IDC_NEW_INCOGNITO_WINDOW); 304 CreateMenuItem(menu, IDC_NEW_INCOGNITO_WINDOW);
305 NSMenuItem* close_window_menu_item = CreateMenuItem(menu, IDC_CLOSE_WINDOW); 305 NSMenuItem* close_window_menu_item = CreateMenuItem(menu, IDC_CLOSE_WINDOW);
306 NSMenuItem* find_menu_item = CreateMenuItem(menu, IDC_FIND); 306 NSMenuItem* find_menu_item = CreateMenuItem(menu, IDC_FIND);
307 NSMenuItem* find_previous_menu_item = CreateMenuItem(menu, IDC_FIND_PREVIOUS); 307 NSMenuItem* find_previous_menu_item = CreateMenuItem(menu, IDC_FIND_PREVIOUS);
308 NSMenuItem* find_next_menu_item = CreateMenuItem(menu, IDC_FIND_NEXT); 308 NSMenuItem* find_next_menu_item = CreateMenuItem(menu, IDC_FIND_NEXT);
309 NSMenuItem* fullscreen_menu_item = CreateMenuItem(menu, IDC_FULLSCREEN); 309 NSMenuItem* fullscreen_menu_item = CreateMenuItem(menu, IDC_FULLSCREEN);
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
400 NSWindow* frontmostWindow = [[NSApp orderedWindows] objectAtIndex:0]; 400 NSWindow* frontmostWindow = [[NSApp orderedWindows] objectAtIndex:0];
401 EXPECT_NSEQ(frontmostWindow, [native_window->controller_ window]); 401 EXPECT_NSEQ(frontmostWindow, [native_window->controller_ window]);
402 402
403 native_window2->ActivatePanel(); 403 native_window2->ActivatePanel();
404 frontmostWindow = [[NSApp orderedWindows] objectAtIndex:0]; 404 frontmostWindow = [[NSApp orderedWindows] objectAtIndex:0];
405 EXPECT_NSEQ(frontmostWindow, [native_window2->controller_ window]); 405 EXPECT_NSEQ(frontmostWindow, [native_window2->controller_ window]);
406 406
407 ClosePanelAndWait(panel); 407 ClosePanelAndWait(panel);
408 ClosePanelAndWait(panel2); 408 ClosePanelAndWait(panel2);
409 } 409 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698