OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/test/base/browser_with_test_window_test.h" | 5 #include "chrome/test/base/browser_with_test_window_test.h" |
6 | 6 |
7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
8 #include <ole2.h> | 8 #include <ole2.h> |
9 #endif // defined(OS_WIN) | 9 #endif // defined(OS_WIN) |
10 | 10 |
(...skipping 27 matching lines...) Expand all Loading... |
38 window_.reset(new TestBrowserWindow(browser())); | 38 window_.reset(new TestBrowserWindow(browser())); |
39 browser_->set_window(window_.get()); | 39 browser_->set_window(window_.get()); |
40 } | 40 } |
41 | 41 |
42 BrowserWithTestWindowTest::~BrowserWithTestWindowTest() { | 42 BrowserWithTestWindowTest::~BrowserWithTestWindowTest() { |
43 // A Task is leaked if we don't destroy everything, then run the message | 43 // A Task is leaked if we don't destroy everything, then run the message |
44 // loop. | 44 // loop. |
45 DestroyBrowser(); | 45 DestroyBrowser(); |
46 profile_.reset(NULL); | 46 profile_.reset(NULL); |
47 | 47 |
48 MessageLoop::current()->PostTask(FROM_HERE, new MessageLoop::QuitTask); | 48 MessageLoop::current()->PostTask(FROM_HERE, MessageLoop::QuitClosure()); |
49 MessageLoop::current()->Run(); | 49 MessageLoop::current()->Run(); |
50 | 50 |
51 #if defined(OS_WIN) | 51 #if defined(OS_WIN) |
52 OleUninitialize(); | 52 OleUninitialize(); |
53 #endif | 53 #endif |
54 } | 54 } |
55 | 55 |
56 TestRenderViewHost* BrowserWithTestWindowTest::TestRenderViewHostForTab( | 56 TestRenderViewHost* BrowserWithTestWindowTest::TestRenderViewHostForTab( |
57 TabContents* tab_contents) { | 57 TabContents* tab_contents) { |
58 return static_cast<TestRenderViewHost*>( | 58 return static_cast<TestRenderViewHost*>( |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 // Make sure we close all tabs, otherwise Browser isn't happy in its | 130 // Make sure we close all tabs, otherwise Browser isn't happy in its |
131 // destructor. | 131 // destructor. |
132 browser()->CloseAllTabs(); | 132 browser()->CloseAllTabs(); |
133 browser_.reset(NULL); | 133 browser_.reset(NULL); |
134 window_.reset(NULL); | 134 window_.reset(NULL); |
135 } | 135 } |
136 | 136 |
137 TestingProfile* BrowserWithTestWindowTest::CreateProfile() { | 137 TestingProfile* BrowserWithTestWindowTest::CreateProfile() { |
138 return new TestingProfile(); | 138 return new TestingProfile(); |
139 } | 139 } |
OLD | NEW |