Check in style perftest data files.
This has been living outside of the tree forever, but we've finally
arranged for a GCS bucket for them. (The files themselves are not stored
in git, only SHA1 hashes are, so that we can easier manage their
lifespan if needed. This was a request from Legal back in April.)
Change-Id: I1e9b1666cba99cc9fd68565f16a387472e68879e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3928777
Reviewed-by: Philip Jägenstedt <foolip@chromium.org>
Commit-Queue: Philip Jägenstedt <foolip@chromium.org>
Reviewed-by: Anders Hartvoll Ruud <andruud@chromium.org>
Auto-Submit: Steinar H Gunderson <sesse@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1054174}
diff --git a/DEPS b/DEPS
index 7e723736..d37deab4 100644
--- a/DEPS
+++ b/DEPS
@@ -4879,6 +4879,17 @@
'condition': 'host_os == "win"',
'action': ['python3', 'src/build/del_ninja_deps_cache.py'],
},
+ # Download test resources for the style perftest.
+ {
+ 'name': 'style_perftest_files',
+ 'pattern': '.',
+ 'action': ['python3',
+ 'src/third_party/depot_tools/download_from_google_storage.py',
+ '--no_auth',
+ '--quiet',
+ '--bucket', 'chromium-style-perftest',
+ '-d', 'src/third_party/blink/renderer/core/css/perftest_data'],
+ },
]
# Add any corresponding DEPS files from this list to chromium.exclusions in
diff --git a/third_party/blink/renderer/core/css/perftest_data/ecommerce.json.sha1 b/third_party/blink/renderer/core/css/perftest_data/ecommerce.json.sha1
new file mode 100644
index 0000000..4aceb11
--- /dev/null
+++ b/third_party/blink/renderer/core/css/perftest_data/ecommerce.json.sha1
@@ -0,0 +1 @@
+e9ce994346c62f8c9fd6d0cecb2b2b0b93b4c2d8
\ No newline at end of file
diff --git a/third_party/blink/renderer/core/css/perftest_data/encyclopedia.json.sha1 b/third_party/blink/renderer/core/css/perftest_data/encyclopedia.json.sha1
new file mode 100644
index 0000000..3381cde
--- /dev/null
+++ b/third_party/blink/renderer/core/css/perftest_data/encyclopedia.json.sha1
@@ -0,0 +1 @@
+756068da5e551516b23b0ba133e55c144f623d38
\ No newline at end of file
diff --git a/third_party/blink/renderer/core/css/perftest_data/extension.json.sha1 b/third_party/blink/renderer/core/css/perftest_data/extension.json.sha1
new file mode 100644
index 0000000..e4db186e
--- /dev/null
+++ b/third_party/blink/renderer/core/css/perftest_data/extension.json.sha1
@@ -0,0 +1 @@
+314e4e0d5e89ea9e9e9a234c617b4413adf48aa9
\ No newline at end of file
diff --git a/third_party/blink/renderer/core/css/perftest_data/news.json.sha1 b/third_party/blink/renderer/core/css/perftest_data/news.json.sha1
new file mode 100644
index 0000000..91aac92b
--- /dev/null
+++ b/third_party/blink/renderer/core/css/perftest_data/news.json.sha1
@@ -0,0 +1 @@
+3a19b42a7c46257b716d55d6733f070c87180b1e
\ No newline at end of file
diff --git a/third_party/blink/renderer/core/css/perftest_data/search.json.sha1 b/third_party/blink/renderer/core/css/perftest_data/search.json.sha1
new file mode 100644
index 0000000..62cf062
--- /dev/null
+++ b/third_party/blink/renderer/core/css/perftest_data/search.json.sha1
@@ -0,0 +1 @@
+fdc43ee18cbd65487249441849f58aa13484aaef
\ No newline at end of file
diff --git a/third_party/blink/renderer/core/css/perftest_data/social1.json.sha1 b/third_party/blink/renderer/core/css/perftest_data/social1.json.sha1
new file mode 100644
index 0000000..417285b
--- /dev/null
+++ b/third_party/blink/renderer/core/css/perftest_data/social1.json.sha1
@@ -0,0 +1 @@
+7fc9338af75b7d9d185c91ddf262a356def5623d
\ No newline at end of file
diff --git a/third_party/blink/renderer/core/css/perftest_data/social2.json.sha1 b/third_party/blink/renderer/core/css/perftest_data/social2.json.sha1
new file mode 100644
index 0000000..97f7a1c
--- /dev/null
+++ b/third_party/blink/renderer/core/css/perftest_data/social2.json.sha1
@@ -0,0 +1 @@
+c2d7e9ce67522dad138c7feb0a6911b828bfb130
\ No newline at end of file
diff --git a/third_party/blink/renderer/core/css/perftest_data/sports.json.sha1 b/third_party/blink/renderer/core/css/perftest_data/sports.json.sha1
new file mode 100644
index 0000000..54f6710
--- /dev/null
+++ b/third_party/blink/renderer/core/css/perftest_data/sports.json.sha1
@@ -0,0 +1 @@
+031d5599c8a21118754e30dbea141be66104f556
\ No newline at end of file
diff --git a/third_party/blink/renderer/core/css/perftest_data/video.json.sha1 b/third_party/blink/renderer/core/css/perftest_data/video.json.sha1
new file mode 100644
index 0000000..b75fee8
--- /dev/null
+++ b/third_party/blink/renderer/core/css/perftest_data/video.json.sha1
@@ -0,0 +1 @@
+8aac3db2a8c9e44babec81e539a3d60aeab4985c
\ No newline at end of file
diff --git a/third_party/blink/renderer/core/css/style_perftest.cc b/third_party/blink/renderer/core/css/style_perftest.cc
index 52414f1..489c18f9 100644
--- a/third_party/blink/renderer/core/css/style_perftest.cc
+++ b/third_party/blink/renderer/core/css/style_perftest.cc
@@ -148,7 +148,8 @@
std::unique_ptr<DummyPageHolder> page;
{
- scoped_refptr<SharedBuffer> serialized = test::ReadFromFile(filename);
+ scoped_refptr<SharedBuffer> serialized =
+ test::ReadFromFile(test::StylePerfTestDataPath(filename));
absl::optional<base::Value> json = base::JSONReader::Read(
base::StringPiece(serialized->Data(), serialized->size()));
if (!json.has_value()) {
diff --git a/third_party/blink/renderer/platform/testing/unit_test_helpers.cc b/third_party/blink/renderer/platform/testing/unit_test_helpers.cc
index d7c63e54..c8bd695 100644
--- a/third_party/blink/renderer/platform/testing/unit_test_helpers.cc
+++ b/third_party/blink/renderer/platform/testing/unit_test_helpers.cc
@@ -140,6 +140,13 @@
.Append(WebStringToFilePath(relative_path)));
}
+String StylePerfTestDataPath(const String& relative_path) {
+ return FilePathToWebString(
+ BlinkRootFilePath()
+ .Append(FILE_PATH_LITERAL("renderer/core/css/perftest_data"))
+ .Append(WebStringToFilePath(relative_path)));
+}
+
LineReader::LineReader(const String& text) : text_(text), index_(0) {}
bool LineReader::GetNextLine(String* line) {
diff --git a/third_party/blink/renderer/platform/testing/unit_test_helpers.h b/third_party/blink/renderer/platform/testing/unit_test_helpers.h
index 790db32..2b844223 100644
--- a/third_party/blink/renderer/platform/testing/unit_test_helpers.h
+++ b/third_party/blink/renderer/platform/testing/unit_test_helpers.h
@@ -80,11 +80,17 @@
String AccessibilityTestDataPath(const String& relative_path = String());
// Returns Blink web_tests fonts as an absolute path, i.e.
-// <blinkRootDir>/src/third_party/blink/web_tests/external/wpt/fonts/<relative_path>.
+// <blinkRootDir>/web_tests/external/wpt/fonts/<relative_path>.
// It returns the top fonts test directory if |relative_path| was not
// specified.
String BlinkWebTestsFontsTestDataPath(const String& relative_path = String());
+// Returns Blink style perftest data as an absolute path, i.e.
+// <blinkRootDir>/renderer/core/css/perftest_data/<relative_path>.
+// It returns the top perftest data directory if |relative_path| was not
+// specified.
+String StylePerfTestDataPath(const String& relative_path = String());
+
// Returns the directory of hyphenation dictionaries for testing.
base::FilePath HyphenationDictionaryDir();