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

Unified Diff: content/browser/download/mhtml_generation_browsertest.cc

Issue 10831023: Move over a bunch of tests from browser_tests to content_browsertests. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/download/mhtml_generation_browsertest.cc
===================================================================
--- content/browser/download/mhtml_generation_browsertest.cc (revision 148472)
+++ content/browser/download/mhtml_generation_browsertest.cc (working copy)
@@ -4,21 +4,19 @@
#include "base/bind.h"
#include "base/file_path.h"
+#include "base/run_loop.h"
#include "base/scoped_temp_dir.h"
-#include "chrome/browser/ui/browser.h"
-#include "chrome/browser/ui/browser_tabstrip.h"
-#include "chrome/test/base/in_process_browser_test.h"
-#include "chrome/test/base/testing_browser_process.h"
-#include "chrome/test/base/ui_test_utils.h"
#include "content/public/browser/web_contents.h"
+#include "content/public/test/test_utils.h"
+#include "content/shell/shell.h"
+#include "content/test/content_browser_test.h"
+#include "content/test/content_browser_test_utils.h"
#include "net/test/test_server.h"
#include "testing/gtest/include/gtest/gtest.h"
-using content::WebContents;
+namespace content {
-namespace {
-
-class MHTMLGenerationTest : public InProcessBrowserTest {
+class MHTMLGenerationTest : public ContentBrowserTest {
public:
MHTMLGenerationTest() : mhtml_generated_(false), file_size_(0) {}
@@ -31,7 +29,7 @@
protected:
virtual void SetUp() {
ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
- InProcessBrowserTest::SetUp();
+ ContentBrowserTest::SetUp();
}
bool mhtml_generated() const { return mhtml_generated_; }
@@ -54,16 +52,14 @@
FilePath path(temp_dir_.path());
path = path.Append(FILE_PATH_LITERAL("test.mht"));
- ui_test_utils::NavigateToURL(browser(),
- test_server()->GetURL("files/google/google.html"));
+ NavigateToURL(shell(), test_server()->GetURL("files/simple_page.html"));
- WebContents* web_contents = chrome::GetActiveWebContents(browser());
- web_contents->GenerateMHTML(path,
- base::Bind(&MHTMLGenerationTest::MHTMLGenerated,
- this));
+ shell()->web_contents()->GenerateMHTML(
+ path, base::Bind(&MHTMLGenerationTest::MHTMLGenerated, this));
// Block until the MHTML is generated.
- ui_test_utils::RunMessageLoop();
+ base::RunLoop run_loop;
+ RunThisRunLoop(&run_loop);
EXPECT_TRUE(mhtml_generated());
EXPECT_GT(file_size(), 0);
@@ -74,4 +70,4 @@
EXPECT_GT(file_size, 100);
}
-} // namespace
+} // namespace content
« no previous file with comments | « content/browser/dom_storage/dom_storage_browsertest.cc ('k') | content/browser/fileapi/file_system_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698