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

Unified Diff: content/renderer/dom_serializer_browsertest.cc

Issue 2175933002: More aggressive IO asserts in content_browsertests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use 1 less instance of ScopedAllowIO in DumpAccessibilityTestBase::RunTestForPlatform. Created 4 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
« no previous file with comments | « content/public/test/content_browser_test_utils.cc ('k') | content/test/content_browser_test_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/dom_serializer_browsertest.cc
diff --git a/content/renderer/dom_serializer_browsertest.cc b/content/renderer/dom_serializer_browsertest.cc
index d475fe2e0daac79a39fd2f5a10517ab48fa51e7d..9c6993a66569bb4a300e40e63a9e07e78abf6e14 100644
--- a/content/renderer/dom_serializer_browsertest.cc
+++ b/content/renderer/dom_serializer_browsertest.cc
@@ -13,6 +13,7 @@
#include "base/files/file_util.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
+#include "base/threading/thread_restrictions.h"
#include "build/build_config.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/web_contents.h"
@@ -684,13 +685,19 @@ IN_PROC_BROWSER_TEST_F(DomSerializerTests,
base::FilePath page_file_path =
GetTestFilePath("dom_serializer", "note.html");
base::FilePath xml_file_path = GetTestFilePath("dom_serializer", "note.xml");
- // Read original contents for later comparison.
+
std::string original_contents;
- ASSERT_TRUE(base::ReadFileToString(xml_file_path, &original_contents));
+ {
+ // Read original contents for later comparison.
+ base::ThreadRestrictions::ScopedAllowIO allow_io_for_test_verifications;
+ ASSERT_TRUE(base::ReadFileToString(xml_file_path, &original_contents));
+ }
+
// Get file URL.
GURL file_url = net::FilePathToFileURL(page_file_path);
GURL xml_file_url = net::FilePathToFileURL(xml_file_path);
ASSERT_TRUE(file_url.SchemeIsFile());
+
// Load the test file.
NavigateToURL(shell(), file_url);
@@ -704,9 +711,14 @@ IN_PROC_BROWSER_TEST_F(DomSerializerTests,
IN_PROC_BROWSER_TEST_F(DomSerializerTests, SerializeHTMLDOMWithAddingMOTW) {
base::FilePath page_file_path =
GetTestFilePath("dom_serializer", "youtube_2.htm");
- // Read original contents for later comparison .
+
std::string original_contents;
- ASSERT_TRUE(base::ReadFileToString(page_file_path, &original_contents));
+ {
+ // Read original contents for later comparison .
+ base::ThreadRestrictions::ScopedAllowIO allow_io_for_test_verifications;
+ ASSERT_TRUE(base::ReadFileToString(page_file_path, &original_contents));
+ }
+
// Get file URL.
GURL file_url = net::FilePathToFileURL(page_file_path);
ASSERT_TRUE(file_url.SchemeIsFile());
« no previous file with comments | « content/public/test/content_browser_test_utils.cc ('k') | content/test/content_browser_test_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698