Commit 7669a668 authored by Nektarios Paisios's avatar Nektarios Paisios Committed by Commit Bot

Ensures that selection test data files are non-empty on the bots by adding...

Ensures that selection test data files are non-empty on the bots by adding data dependency to the BUILD file

In case the files are somehow not found or unreadable on the bots, the tests should fail.
R=dmazzoni@chromium.org

Change-Id: I31668ab7a1b023a9eeda251b3ae0e7079f262171
Reviewed-on: https://chromium-review.googlesource.com/c/1324232Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Reviewed-by: default avatarDominic Mazzoni <dmazzoni@chromium.org>
Commit-Queue: Nektarios Paisios <nektar@chromium.org>
Cr-Commit-Position: refs/heads/master@{#606858}
parent 56904b67
...@@ -374,4 +374,14 @@ jumbo_source_set("unit_tests") { ...@@ -374,4 +374,14 @@ jumbo_source_set("unit_tests") {
"//third_party/webrtc/rtc_base:rtc_base", "//third_party/webrtc/rtc_base:rtc_base",
"//v8", "//v8",
] ]
data_deps = [
":accessibility_unittests_data",
]
}
group("accessibility_unittests_data") {
data = [
"accessibility/testing/data/",
]
} }
...@@ -393,6 +393,10 @@ void AccessibilitySelectionTest::RunSelectionTest( ...@@ -393,6 +393,10 @@ void AccessibilitySelectionTest::RunSelectionTest(
std::string test_file_contents; std::string test_file_contents;
std::copy(test_file_chars.begin(), test_file_chars.end(), std::copy(test_file_chars.begin(), test_file_chars.end(),
std::back_inserter(test_file_contents)); std::back_inserter(test_file_contents));
ASSERT_FALSE(test_file_contents.empty())
<< "Test file cannot be empty.\n"
<< test_file.Utf8().data()
<< "\nDid you forget to add a data dependency to the BUILD file?";
const String ax_file = test_path + String::FromUTF8(kAXTestExpectationSuffix); const String ax_file = test_path + String::FromUTF8(kAXTestExpectationSuffix);
scoped_refptr<SharedBuffer> ax_file_buffer = ReadFromFile(ax_file); scoped_refptr<SharedBuffer> ax_file_buffer = ReadFromFile(ax_file);
...@@ -400,6 +404,10 @@ void AccessibilitySelectionTest::RunSelectionTest( ...@@ -400,6 +404,10 @@ void AccessibilitySelectionTest::RunSelectionTest(
std::string ax_file_contents; std::string ax_file_contents;
std::copy(ax_file_chars.begin(), ax_file_chars.end(), std::copy(ax_file_chars.begin(), ax_file_chars.end(),
std::back_inserter(ax_file_contents)); std::back_inserter(ax_file_contents));
ASSERT_FALSE(ax_file_contents.empty())
<< "Expectations file cannot be empty.\n"
<< ax_file.Utf8().data()
<< "\nDid you forget to add a data dependency to the BUILD file?";
HTMLElement* body = GetDocument().body(); HTMLElement* body = GetDocument().body();
ASSERT_NE(nullptr, body); ASSERT_NE(nullptr, body);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment