Commit 743c7190 authored by Doug Arnett's avatar Doug Arnett Committed by Commit Bot

[Previews] Moves PreviewsNoScript* browsertests to use PageHint config

Bug: 902802
Change-Id: I6354768076f57e2c2678e3e051f8bb97c43b4b16
Reviewed-on: https://chromium-review.googlesource.com/c/1336441Reviewed-by: default avatarTarun Bansal <tbansal@chromium.org>
Commit-Queue: Doug Arnett <dougarnett@chromium.org>
Cr-Commit-Position: refs/heads/master@{#608406}
parent b3de1b05
......@@ -218,8 +218,9 @@ class PreviewsNoScriptBrowserTest : public PreviewsBrowserTest {
base::RunLoop().RunUntilIdle();
const optimization_guide::ComponentInfo& component_info =
test_component_creator_.CreateComponentInfoWithTopLevelWhitelist(
optimization_guide::proto::NOSCRIPT, whitelisted_noscript_sites);
test_component_creator_.CreateComponentInfoWithPageHints(
optimization_guide::proto::NOSCRIPT, whitelisted_noscript_sites,
{});
g_browser_process->optimization_guide_service()->ProcessHints(
component_info);
......
......@@ -23,24 +23,6 @@ TestComponentCreator::~TestComponentCreator() {
scoped_temp_dir_.reset();
}
optimization_guide::ComponentInfo
TestComponentCreator::CreateComponentInfoWithTopLevelWhitelist(
optimization_guide::proto::OptimizationType optimization_type,
const std::vector<std::string>& whitelisted_host_suffixes) {
optimization_guide::proto::Configuration config;
for (const auto& whitelisted_site : whitelisted_host_suffixes) {
optimization_guide::proto::Hint* hint = config.add_hints();
hint->set_key(whitelisted_site);
hint->set_key_representation(optimization_guide::proto::HOST_SUFFIX);
optimization_guide::proto::Optimization* optimization =
hint->add_whitelisted_optimizations();
optimization->set_optimization_type(optimization_type);
}
return WriteConfigToFileAndReturnComponentInfo(config);
}
optimization_guide::ComponentInfo
TestComponentCreator::CreateComponentInfoWithPageHints(
optimization_guide::proto::OptimizationType optimization_type,
......
......@@ -28,13 +28,6 @@ class TestComponentCreator {
TestComponentCreator();
~TestComponentCreator();
// Creates component data based on |whitelisted_host_suffixes| for
// optimization with type |optimization_type| to a temp file
// and returns the ComponentInfo for it.
optimization_guide::ComponentInfo CreateComponentInfoWithTopLevelWhitelist(
optimization_guide::proto::OptimizationType optimization_type,
const std::vector<std::string>& whitelisted_host_suffixes);
// Creates component data based on |whitelisted_host_suffixes| with page hints
// for type |optimization_type| blocking resources specified by
// |resource_patterns|, and returns the ComponentInfo for it.
......
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