Commit 577b29ee authored by alokp's avatar alokp Committed by Commit bot

Moving mojo/validation test into LayoutTests

BUG=647036
TBR=yzshen,dpranke,jbroman

Review-Url: https://codereview.chromium.org/2853293003
Cr-Commit-Position: refs/heads/master@{#469506}
parent 56aabec6
......@@ -872,8 +872,8 @@ if (!is_ios) {
data_deps = [
":layout_test_data_mojo_bindings",
"//content/shell:content_shell",
"//mojo/public/interfaces/bindings/tests",
"//mojo/public/interfaces/bindings/tests:test_associated_interfaces",
"//mojo/public/interfaces/bindings/tests:test_interfaces",
"//third_party/WebKit/public:blink_devtools_frontend_resources_files",
"//third_party/mesa:osmesa",
"//tools/imagediff",
......
......@@ -51,10 +51,6 @@ TEST(JSTest, Core) {
RunTest("core_unittest.js", true);
}
TEST(JSTest, Validation) {
RunTest("validation_unittest.js", true);
}
} // namespace
} // namespace js
} // namespace edk
......
......@@ -4,6 +4,44 @@
import("../../../tools/bindings/mojom.gni")
group("tests") {
testonly = true
deps = [
":test_interfaces",
]
data_deps = [
":test_data",
":test_data_list",
]
}
copy("test_data") {
testonly = true
sources = [
"data/validation",
]
outputs = [
"$root_gen_dir/layout_test_data/{{source_root_relative_dir}}/{{source_file_part}}",
]
}
action_foreach("test_data_list") {
testonly = true
script = "//mojo/public/tools/bindings/gen_data_files_list.py"
sources = [
"data/validation",
]
outputs = [
"$root_gen_dir/layout_test_data/{{source_root_relative_dir}}/{{source_file_part}}_index.txt",
]
args = [
"-d",
rebase_path(sources[0], root_build_dir),
"-o",
rebase_path(outputs[0], root_build_dir),
]
}
mojom("test_interfaces") {
testonly = true
sources = [
......
......@@ -82,10 +82,7 @@ group("tests") {
testonly = true
data = [
"//mojo/public/interfaces/bindings/tests/data/validation/",
"tests/core_unittest.js",
"tests/validation_test_input_parser.js",
"tests/validation_unittest.js",
]
public_deps = [
......
This diff is collapsed.
# Copyright 2017 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Generates a list of all files in a directory.
This script takes in a directory and an output file name as input.
It then reads the directory and creates a list of all file names
in that directory. The list is written to the output file.
There is also an option to pass in '-p' or '--pattern'
which will check each file name against a regular expression
pattern that is passed in. Only files which match the regex
will be written to the list.
"""
from optparse import OptionParser
import os
import re
import sys
def main():
parser = OptionParser()
parser.add_option('-d', '--directory', help='Read files from DIRECTORY')
parser.add_option('-o', '--output', help='Write list to FILE')
parser.add_option('-p',
'--pattern',
help='Only reads files that name matches PATTERN',
default=".")
(options, _) = parser.parse_args()
pattern = re.compile(options.pattern)
files = [f for f in os.listdir(options.directory) if pattern.match(f)]
with file(options.output, 'w') as out:
for f in files:
print >> out, f
if __name__ == '__main__':
sys.exit(main())
......@@ -6,7 +6,7 @@
// or ".data" files. The input format is described here:
// mojo/public/cpp/bindings/tests/validation_test_input_parser.h
define([
define("mojo/resources/validation_test_input_parser", [
"mojo/public/js/buffer"
], function(buffer) {
......@@ -14,6 +14,7 @@ define([
// or ".data" file.
function InputError(message, line) {
this.name = "InputError";
this.message = message;
this.line = line;
}
......
This diff is collapsed.
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