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

Unified Diff: components/autofill/core/browser/data_driven_test.cc

Issue 2835233002: Fix integration tests in src/chrome and src/extensions so that we can turn on IO thread checks wi... (Closed)
Patch Set: ready for review Created 3 years, 8 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 | « chrome/test/remoting/qunit_browser_test_runner.cc ('k') | components/drive/service/fake_drive_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/autofill/core/browser/data_driven_test.cc
diff --git a/components/autofill/core/browser/data_driven_test.cc b/components/autofill/core/browser/data_driven_test.cc
index c3397587073eb6e86012043a9199da43482c3687..e778a8a744f091db3502033f920a675bbb581dae 100644
--- a/components/autofill/core/browser/data_driven_test.cc
+++ b/components/autofill/core/browser/data_driven_test.cc
@@ -7,6 +7,7 @@
#include "base/files/file_enumerator.h"
#include "base/files/file_util.h"
#include "base/strings/string_util.h"
+#include "base/threading/thread_restrictions.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace autofill {
@@ -35,6 +36,7 @@ void DataDrivenTest::RunDataDrivenTest(
const base::FilePath& input_directory,
const base::FilePath& output_directory,
const base::FilePath::StringType& file_name_pattern) {
+ base::ThreadRestrictions::ScopedAllowIO allow_io;
ASSERT_TRUE(base::DirectoryExists(input_directory));
ASSERT_TRUE(base::DirectoryExists(output_directory));
base::FileEnumerator input_files(input_directory,
@@ -52,6 +54,7 @@ void DataDrivenTest::RunDataDrivenTest(
void DataDrivenTest::RunOneDataDrivenTest(
const base::FilePath& test_file_name,
const base::FilePath& output_directory) {
+ base::ThreadRestrictions::ScopedAllowIO allow_io;
// iOS doesn't get rid of removed test files. TODO(estade): remove this after
// all iOS bots are clobbered.
if (test_file_name.BaseName().value() == FILE_PATH_LITERAL("multimerge.in"))
@@ -64,7 +67,9 @@ void DataDrivenTest::RunOneDataDrivenTest(
ReadFile(test_file_name, &input);
std::string output;
+ base::ThreadRestrictions::SetIOAllowed(false);
GenerateResults(input, &output);
+ base::ThreadRestrictions::SetIOAllowed(true);
base::FilePath output_file = output_directory.Append(
test_file_name.BaseName().StripTrailingSeparators().ReplaceExtension(
« no previous file with comments | « chrome/test/remoting/qunit_browser_test_runner.cc ('k') | components/drive/service/fake_drive_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698