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

Unified 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: 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/tab_contents/test_tab_contents.cc
diff --git a/chrome/browser/ui/tab_contents/test_tab_contents.cc b/chrome/browser/ui/tab_contents/test_tab_contents.cc
new file mode 100644
index 0000000000000000000000000000000000000000..a28e1176a7a1fe13c547a7e1c880d93c923e4df9
--- /dev/null
+++ b/chrome/browser/ui/tab_contents/test_tab_contents.cc
@@ -0,0 +1,49 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/ui/tab_contents/test_tab_contents.h"
+
+#include "chrome/browser/ui/tab_contents/tab_contents.h"
+#include "chrome/test/base/testing_profile.h"
+#include "content/public/browser/web_contents.h"
+
+using content::WebContents;
+
+TabContentsTestHarness::TabContentsTestHarness()
+ : ChromeRenderViewHostTestHarness() {
+}
+
+TabContentsTestHarness::~TabContentsTestHarness() {
+}
+
+WebContents* TabContentsTestHarness::web_contents() {
+ return tab_contents_.get() ? tab_contents_->web_contents() : NULL;
+}
+
+TabContents* TabContentsTestHarness::tab_contents() {
+ return tab_contents_.get();
+}
+
+void TabContentsTestHarness::SetContents(WebContents* contents) {
+ tab_contents_.reset(contents ? new TabContents(contents) : NULL);
+}
+
+void TabContentsTestHarness::SetUp() {
+ ChromeRenderViewHostTestHarness::SetUp();
+ SetContents(CreateTestWebContents());
+}
+
+void TabContentsTestHarness::TearDown() {
+ tab_contents_.reset();
+
+ // Make sure that we flush any messages related to WebContents destruction
+ // before we destroy the browser context.
+ MessageLoop::current()->RunAllPending();
+
+ // Release the browser context on the UI thread.
+ message_loop_.DeleteSoon(FROM_HERE, browser_context_.release());
+ message_loop_.RunAllPending();
+
+ ChromeRenderViewHostTestHarness::TearDown();
+}

Powered by Google App Engine
This is Rietveld 408576698