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

Unified Diff: chrome/browser/download/save_page_browsertest.cc

Issue 1407663004: Tweaking WebPageSerializerImpl to emit a BOM for UTF16/32. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Reverting unnecessary embedded_test_server.cc changes. Created 5 years, 2 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
« no previous file with comments | « no previous file | chrome/test/data/save_page/utf32.htm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/download/save_page_browsertest.cc
diff --git a/chrome/browser/download/save_page_browsertest.cc b/chrome/browser/download/save_page_browsertest.cc
index 67ba540264c7f25e972b1f065888092133f07788..2672ff8c3e947d59380f61ddf8f086a5a29a0acc 100644
--- a/chrome/browser/download/save_page_browsertest.cc
+++ b/chrome/browser/download/save_page_browsertest.cc
@@ -547,7 +547,7 @@ IN_PROC_BROWSER_TEST_F(SavePageBrowserTest, DISABLED_SaveCompleteHTML) {
EXPECT_TRUE(base::PathExists(full_file_name));
EXPECT_TRUE(base::PathExists(dir));
- EXPECT_TRUE(base::TextContentsEqual(
+ EXPECT_TRUE(base::ContentsEqual(
test_dir_.Append(base::FilePath(kTestDir)).AppendASCII("b.saved1.htm"),
full_file_name));
EXPECT_TRUE(base::ContentsEqual(
@@ -558,6 +558,34 @@ IN_PROC_BROWSER_TEST_F(SavePageBrowserTest, DISABLED_SaveCompleteHTML) {
dir.AppendASCII("1.css")));
}
+// Disabled on Windows due to flakiness. http://crbug.com/162323
Randy Smith (Not in Mondays) 2015/10/15 18:57:06 This is a new test; have you confirmed that it's f
Łukasz Anforowicz 2015/10/20 21:08:43 Done. Also following up with the following CLs: -
+#if defined(OS_WIN)
+#define MAYBE_SaveUTF32CompleteHTML DISABLED_SaveUTF32CompleteHTML
+#else
+#define MAYBE_SaveUTF32CompleteHTML SaveUTF32CompleteHTML
+#endif
+IN_PROC_BROWSER_TEST_F(SavePageBrowserTest, MAYBE_SaveUTF32CompleteHTML) {
+ GURL url = NavigateToMockURL("utf32");
+ ui_test_utils::NavigateToURL(browser(), url);
+
+ base::FilePath full_file_name, dir;
+ SaveCurrentTab(url, content::SAVE_PAGE_TYPE_AS_COMPLETE_HTML, "utf32", 3,
+ &dir, &full_file_name);
+ ASSERT_FALSE(HasFailure());
+
+ EXPECT_TRUE(base::PathExists(full_file_name));
+ EXPECT_TRUE(base::PathExists(dir));
+ EXPECT_TRUE(base::ContentsEqual(
Randy Smith (Not in Mondays) 2015/10/15 18:57:06 I wince a bit at this, since it tests the implemen
Łukasz Anforowicz 2015/10/20 21:08:43 I still think that comparing the whole file conten
+ test_dir_.Append(base::FilePath(kTestDir)).AppendASCII("utf32.saved.htm"),
+ full_file_name));
+ EXPECT_TRUE(base::ContentsEqual(
+ test_dir_.Append(base::FilePath(kTestDir)).AppendASCII("1.png"),
+ dir.AppendASCII("1.png")));
+ EXPECT_TRUE(base::ContentsEqual(
+ test_dir_.Append(base::FilePath(kTestDir)).AppendASCII("1.css"),
+ dir.AppendASCII("1.css")));
+}
+
// Invoke a save page during the initial navigation.
// (Regression test for http://crbug.com/156538).
// Disabled on Windows due to flakiness. http://crbug.com/162323
@@ -638,7 +666,7 @@ IN_PROC_BROWSER_TEST_F(SavePageBrowserTest, DISABLED_FileNameFromPageTitle) {
EXPECT_TRUE(base::PathExists(full_file_name));
EXPECT_TRUE(base::PathExists(dir));
- EXPECT_TRUE(base::TextContentsEqual(
+ EXPECT_TRUE(base::ContentsEqual(
test_dir_.Append(base::FilePath(kTestDir)).AppendASCII("b.saved2.htm"),
full_file_name));
EXPECT_TRUE(base::ContentsEqual(
« no previous file with comments | « no previous file | chrome/test/data/save_page/utf32.htm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698