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/browser_with_test_window_test.h" | 5 #include "chrome/test/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 17 matching lines...) Expand all Loading... |
28 OleInitialize(NULL); | 28 OleInitialize(NULL); |
29 #endif | 29 #endif |
30 } | 30 } |
31 | 31 |
32 void BrowserWithTestWindowTest::SetUp() { | 32 void BrowserWithTestWindowTest::SetUp() { |
33 TestingBrowserProcessTest::SetUp(); | 33 TestingBrowserProcessTest::SetUp(); |
34 | 34 |
35 // NOTE: I have a feeling we're going to want virtual methods for creating | 35 // NOTE: I have a feeling we're going to want virtual methods for creating |
36 // these, as such they're in SetUp instead of the constructor. | 36 // these, as such they're in SetUp instead of the constructor. |
37 profile_.reset(new TestingProfile()); | 37 profile_.reset(new TestingProfile()); |
38 content::GetContentClient()->set_browser_client(&browser_client_); | 38 content::GetContentClient()->set_browser(&browser_client_); |
39 browser_.reset(new Browser(Browser::TYPE_NORMAL, profile())); | 39 browser_.reset(new Browser(Browser::TYPE_NORMAL, profile())); |
40 window_.reset(new TestBrowserWindow(browser())); | 40 window_.reset(new TestBrowserWindow(browser())); |
41 browser_->set_window(window_.get()); | 41 browser_->set_window(window_.get()); |
42 } | 42 } |
43 | 43 |
44 BrowserWithTestWindowTest::~BrowserWithTestWindowTest() { | 44 BrowserWithTestWindowTest::~BrowserWithTestWindowTest() { |
45 // Make sure we close all tabs, otherwise Browser isn't happy in its | 45 // Make sure we close all tabs, otherwise Browser isn't happy in its |
46 // destructor. | 46 // destructor. |
47 browser()->CloseAllTabs(); | 47 browser()->CloseAllTabs(); |
48 | 48 |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 void BrowserWithTestWindowTest::NavigateAndCommit( | 100 void BrowserWithTestWindowTest::NavigateAndCommit( |
101 NavigationController* controller, | 101 NavigationController* controller, |
102 const GURL& url) { | 102 const GURL& url) { |
103 controller->LoadURL(url, GURL(), PageTransition::LINK); | 103 controller->LoadURL(url, GURL(), PageTransition::LINK); |
104 CommitPendingLoad(controller); | 104 CommitPendingLoad(controller); |
105 } | 105 } |
106 | 106 |
107 void BrowserWithTestWindowTest::NavigateAndCommitActiveTab(const GURL& url) { | 107 void BrowserWithTestWindowTest::NavigateAndCommitActiveTab(const GURL& url) { |
108 NavigateAndCommit(&browser()->GetSelectedTabContents()->controller(), url); | 108 NavigateAndCommit(&browser()->GetSelectedTabContents()->controller(), url); |
109 } | 109 } |
OLD | NEW |