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

Unified Diff: content/browser/accessibility/dump_accessibility_tree_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
Index: content/browser/accessibility/dump_accessibility_tree_browsertest.cc
diff --git a/content/browser/accessibility/dump_accessibility_tree_browsertest.cc b/content/browser/accessibility/dump_accessibility_tree_browsertest.cc
index d36cd388636223f003a8394b20fc5811f1beef04..b5b8ccdc9a32e568a7f341912872eba86c659ef4 100644
--- a/content/browser/accessibility/dump_accessibility_tree_browsertest.cc
+++ b/content/browser/accessibility/dump_accessibility_tree_browsertest.cc
@@ -12,6 +12,7 @@
#include "base/strings/string_split.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/browser/accessibility/accessibility_tree_formatter.h"
#include "content/browser/accessibility/accessibility_tree_formatter_blink.h"
@@ -22,6 +23,7 @@
#include "content/public/browser/web_contents.h"
#include "content/public/common/content_paths.h"
#include "content/public/common/content_switches.h"
+#include "content/public/test/content_browser_test_utils.h"
#include "content/shell/browser/shell.h"
#include "content/test/accessibility_browser_test_utils.h"
@@ -69,35 +71,35 @@ class DumpAccessibilityTreeTest : public DumpAccessibilityTestBase {
}
void RunAriaTest(const base::FilePath::CharType* file_path) {
- base::FilePath dir_test_data;
- ASSERT_TRUE(PathService::Get(DIR_TEST_DATA, &dir_test_data));
- base::FilePath test_path(dir_test_data.AppendASCII("accessibility")
- .AppendASCII("aria"));
- ASSERT_TRUE(base::PathExists(test_path)) << test_path.LossyDisplayName();
-
+ base::FilePath test_path = GetTestFilePath("accessibility", "aria");
+ {
+ base::ThreadRestrictions::ScopedAllowIO allow_io_for_test_setup;
+ ASSERT_TRUE(base::PathExists(test_path)) << test_path.LossyDisplayName();
+ }
base::FilePath aria_file = test_path.Append(base::FilePath(file_path));
+
RunTest(aria_file, "accessibility/aria");
}
void RunCSSTest(const base::FilePath::CharType* file_path) {
- base::FilePath dir_test_data;
- ASSERT_TRUE(PathService::Get(DIR_TEST_DATA, &dir_test_data));
- base::FilePath test_path(
- dir_test_data.AppendASCII("accessibility").AppendASCII("css"));
- ASSERT_TRUE(base::PathExists(test_path)) << test_path.LossyDisplayName();
-
+ base::FilePath test_path = GetTestFilePath("accessibility", "css");
+ {
+ base::ThreadRestrictions::ScopedAllowIO allow_io_for_test_setup;
+ ASSERT_TRUE(base::PathExists(test_path)) << test_path.LossyDisplayName();
+ }
base::FilePath css_file = test_path.Append(base::FilePath(file_path));
+
RunTest(css_file, "accessibility/css");
}
void RunHtmlTest(const base::FilePath::CharType* file_path) {
- base::FilePath dir_test_data;
- ASSERT_TRUE(PathService::Get(DIR_TEST_DATA, &dir_test_data));
- base::FilePath test_path(dir_test_data.AppendASCII("accessibility")
- .AppendASCII("html"));
- ASSERT_TRUE(base::PathExists(test_path)) << test_path.LossyDisplayName();
-
+ base::FilePath test_path = GetTestFilePath("accessibility", "html");
+ {
+ base::ThreadRestrictions::ScopedAllowIO allow_io_for_test_setup;
+ ASSERT_TRUE(base::PathExists(test_path)) << test_path.LossyDisplayName();
+ }
base::FilePath html_file = test_path.Append(base::FilePath(file_path));
+
RunTest(html_file, "accessibility/html");
}

Powered by Google App Engine
This is Rietveld 408576698