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

Side by Side Diff: chrome/browser/ui/cocoa/toolbar/toolbar_controller_unittest.mm

Issue 1221173003: [Mac] Inform reference counted objects that hold a weak Browser* when the Browser is being destroye… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove dealloc override. Created 5 years, 5 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 #import <Cocoa/Cocoa.h> 5 #import <Cocoa/Cocoa.h>
6 6
7 #import "base/mac/scoped_nsobject.h" 7 #import "base/mac/scoped_nsobject.h"
8 #include "base/prefs/pref_service.h" 8 #include "base/prefs/pref_service.h"
9 #include "base/run_loop.h" 9 #include "base/run_loop.h"
10 #include "chrome/app/chrome_command_ids.h" 10 #include "chrome/app/chrome_command_ids.h"
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 private: 291 private:
292 base::RunLoop run_loop_; 292 base::RunLoop run_loop_;
293 293
294 DISALLOW_COPY_AND_ASSIGN(BrowserRemovedObserver); 294 DISALLOW_COPY_AND_ASSIGN(BrowserRemovedObserver);
295 }; 295 };
296 296
297 // Test that ToolbarController can be destroyed after the Browser. 297 // Test that ToolbarController can be destroyed after the Browser.
298 // This can happen because the ToolbarController is retained by both the 298 // This can happen because the ToolbarController is retained by both the
299 // BrowserWindowController and -[ToolbarController view], the latter of which is 299 // BrowserWindowController and -[ToolbarController view], the latter of which is
300 // autoreleased. 300 // autoreleased.
301 // TODO(nhiroki): This is disabled due to http://crbug.com/506745. 301 TEST_F(ToolbarControllerTest, ToolbarDestroyedAfterBrowser) {
302 TEST_F(ToolbarControllerTest, DISABLED_ToolbarDestroyedAfterBrowser) {
303 BrowserRemovedObserver observer; 302 BrowserRemovedObserver observer;
303 // This is normally called by BrowserWindowController, but since |bar_| is not
304 // owned by one, call it here.
305 [bar_ browserWillBeDestroyed];
304 CloseBrowserWindow(); 306 CloseBrowserWindow();
305 observer.WaitUntilBrowserRemoved(); 307 observer.WaitUntilBrowserRemoved();
306 // |bar_| is released in TearDown(). 308 // |bar_| is released in TearDown().
307 } 309 }
308 310
309 } // namespace 311 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698