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

Side by Side Diff: chrome/browser/ui/tab_contents/test_tab_contents.cc

Issue 10542010: TabContentsWrapper -> TabContents, part 2. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase, rename Created 8 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "chrome/browser/ui/tab_contents/test_tab_contents.h"
6
7 #include "chrome/browser/ui/tab_contents/tab_contents.h"
8 #include "chrome/test/base/testing_profile.h"
9 #include "content/public/browser/web_contents.h"
10
11 using content::WebContents;
12
13 TabContentsTestHarness::TabContentsTestHarness()
14 : ChromeRenderViewHostTestHarness() {
15 }
16
17 TabContentsTestHarness::~TabContentsTestHarness() {
18 }
19
20 WebContents* TabContentsTestHarness::web_contents() {
21 return tab_contents_.get() ? tab_contents_->web_contents() : NULL;
22 }
23
24 TabContents* TabContentsTestHarness::tab_contents() {
25 return tab_contents_.get();
26 }
27
28 void TabContentsTestHarness::SetContents(WebContents* contents) {
29 tab_contents_.reset(contents ? new TabContents(contents) : NULL);
30 }
31
32 void TabContentsTestHarness::SetUp() {
33 ChromeRenderViewHostTestHarness::SetUp();
34 SetContents(CreateTestWebContents());
35 }
36
37 void TabContentsTestHarness::TearDown() {
38 tab_contents_.reset();
39
40 // Make sure that we flush any messages related to WebContents destruction
41 // before we destroy the browser context.
42 MessageLoop::current()->RunAllPending();
43
44 // Release the browser context on the UI thread.
45 message_loop_.DeleteSoon(FROM_HERE, browser_context_.release());
46 message_loop_.RunAllPending();
47
48 ChromeRenderViewHostTestHarness::TearDown();
49 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/tab_contents/test_tab_contents.h ('k') | chrome/browser/ui/webui/web_ui_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698