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

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

Issue 1440593004: Make operators on scoped_ptr match the ones defined for std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: scopedptrequals: followupfix-after-rebase Created 5 years, 1 month 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 <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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 52
53 Panel* panel = manager->CreatePanel(panel_name, profile(), 53 Panel* panel = manager->CreatePanel(panel_name, profile(),
54 GURL(), gfx::Rect(), 54 GURL(), gfx::Rect(),
55 PanelManager::CREATE_AS_DOCKED); 55 PanelManager::CREATE_AS_DOCKED);
56 EXPECT_EQ(panels_count + 1, manager->num_panels()); 56 EXPECT_EQ(panels_count + 1, manager->num_panels());
57 57
58 EXPECT_TRUE(panel); 58 EXPECT_TRUE(panel);
59 EXPECT_TRUE(panel->native_panel()); // Native panel is created right away. 59 EXPECT_TRUE(panel->native_panel()); // Native panel is created right away.
60 PanelCocoa* native_window = 60 PanelCocoa* native_window =
61 static_cast<PanelCocoa*>(panel->native_panel()); 61 static_cast<PanelCocoa*>(panel->native_panel());
62 EXPECT_EQ(panel, native_window->panel_); // Back pointer initialized. 62 EXPECT_EQ(panel, native_window->panel_.get()); // Back pointer initialized.
63 63
64 PanelAnimatedBoundsObserver bounds_observer(panel); 64 PanelAnimatedBoundsObserver bounds_observer(panel);
65 65
66 // Window should not load before Show(). 66 // Window should not load before Show().
67 // Note: Loading the wnidow causes Cocoa to autorelease a few objects. 67 // Note: Loading the wnidow causes Cocoa to autorelease a few objects.
68 // This is the reason we do this within the scope of the 68 // This is the reason we do this within the scope of the
69 // ScopedNSAutoreleasePool. 69 // ScopedNSAutoreleasePool.
70 EXPECT_FALSE([native_window->controller_ isWindowLoaded]); 70 EXPECT_FALSE([native_window->controller_ isWindowLoaded]);
71 panel->Show(); 71 panel->Show();
72 EXPECT_TRUE([native_window->controller_ isWindowLoaded]); 72 EXPECT_TRUE([native_window->controller_ isWindowLoaded]);
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 chrome::testing::NSRunLoopRunAllPending(); 404 chrome::testing::NSRunLoopRunAllPending();
405 frontmostWindow = [[NSApp orderedWindows] objectAtIndex:0]; 405 frontmostWindow = [[NSApp orderedWindows] objectAtIndex:0];
406 EXPECT_NSEQ(frontmostWindow, [native_window2->controller_ window]); 406 EXPECT_NSEQ(frontmostWindow, [native_window2->controller_ window]);
407 407
408 ClosePanelAndWait(panel); 408 ClosePanelAndWait(panel);
409 ClosePanelAndWait(panel2); 409 ClosePanelAndWait(panel2);
410 } 410 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/browser_window_controller_private.mm ('k') | chrome/browser/ui/views/frame/browser_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698