Commit 9ef75c59 authored by James Hawkins's avatar James Hawkins Committed by Commit Bot

cr_component/network: Convert NetworkProxyExclusions to Polymer 3.

R=khorimoto@chromium.org

Bug: 1045266
Test: NetworkComponentsNetworkProxyExclusionsTest*
Change-Id: Ic0f9fbc01f2f31baa893104d93111ed486f4f20b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2411285
Commit-Queue: James Hawkins <jhawkins@chromium.org>
Reviewed-by: default avatarKyle Horimoto <khorimoto@chromium.org>
Cr-Commit-Position: refs/heads/master@{#807129}
parent a20473ce
...@@ -268,6 +268,7 @@ if (include_js_tests) { ...@@ -268,6 +268,7 @@ if (include_js_tests) {
"$root_gen_dir/chrome/test/data/webui/cr_components/chromeos/network/network_nameservers_test.m.js", "$root_gen_dir/chrome/test/data/webui/cr_components/chromeos/network/network_nameservers_test.m.js",
"$root_gen_dir/chrome/test/data/webui/cr_components/chromeos/network/network_password_input_test.m.js", "$root_gen_dir/chrome/test/data/webui/cr_components/chromeos/network/network_password_input_test.m.js",
"$root_gen_dir/chrome/test/data/webui/cr_components/chromeos/network/network_property_list_mojo_test.m.js", "$root_gen_dir/chrome/test/data/webui/cr_components/chromeos/network/network_property_list_mojo_test.m.js",
"$root_gen_dir/chrome/test/data/webui/cr_components/chromeos/network/network_proxy_exclusions_test.m.js",
"$root_gen_dir/chrome/test/data/webui/cr_components/chromeos/network/network_proxy_input_test.m.js", "$root_gen_dir/chrome/test/data/webui/cr_components/chromeos/network/network_proxy_input_test.m.js",
"$root_gen_dir/chrome/test/data/webui/cr_components/chromeos/network/network_select_test.m.js", "$root_gen_dir/chrome/test/data/webui/cr_components/chromeos/network/network_select_test.m.js",
"$root_gen_dir/chrome/test/data/webui/cr_components/chromeos/network/network_siminfo_test.m.js", "$root_gen_dir/chrome/test/data/webui/cr_components/chromeos/network/network_siminfo_test.m.js",
......
...@@ -43,6 +43,7 @@ GEN('#include "content/public/test/browser_test.h"'); ...@@ -43,6 +43,7 @@ GEN('#include "content/public/test/browser_test.h"');
['NetworkNameservers', 'network/network_nameservers_test.js', []], ['NetworkNameservers', 'network/network_nameservers_test.js', []],
['NetworkPasswordInput', 'network/network_password_input_test.js', []], ['NetworkPasswordInput', 'network/network_password_input_test.js', []],
['NetworkPropertyListMojo', 'network/network_property_list_mojo_test.js', []], ['NetworkPropertyListMojo', 'network/network_property_list_mojo_test.js', []],
['NetworkProxyExclusions', 'network/network_proxy_exclusions_test.js', []],
['NetworkProxyInput', 'network/network_proxy_input_test.js', []], ['NetworkProxyInput', 'network/network_proxy_input_test.js', []],
['NetworkSiminfo', 'network/network_siminfo_test.js', []], ['NetworkSiminfo', 'network/network_siminfo_test.js', []],
].forEach(test => registerTest('NetworkComponents', 'os-settings', ...test)); ].forEach(test => registerTest('NetworkComponents', 'os-settings', ...test));
......
...@@ -25,6 +25,7 @@ GEN('#include "chromeos/constants/chromeos_features.h"'); ...@@ -25,6 +25,7 @@ GEN('#include "chromeos/constants/chromeos_features.h"');
['NetworkNameservers', 'network/network_nameservers_test.m.js'], ['NetworkNameservers', 'network/network_nameservers_test.m.js'],
['NetworkPasswordInput', 'network/network_password_input_test.m.js'], ['NetworkPasswordInput', 'network/network_password_input_test.m.js'],
['NetworkPropertyListMojo', 'network/network_property_list_mojo_test.m.js'], ['NetworkPropertyListMojo', 'network/network_property_list_mojo_test.m.js'],
['NetworkProxyExclusions', 'network/network_proxy_exclusions_test.m.js'],
['NetworkProxyInput', 'network/network_proxy_input_test.m.js'], ['NetworkProxyInput', 'network/network_proxy_input_test.m.js'],
['NetworkSelect', 'network/network_select_test.m.js'], ['NetworkSelect', 'network/network_select_test.m.js'],
['NetworkSiminfo', 'network/network_siminfo_test.m.js'], ['NetworkSiminfo', 'network/network_siminfo_test.m.js'],
......
...@@ -21,6 +21,7 @@ js_modulizer("modulize") { ...@@ -21,6 +21,7 @@ js_modulizer("modulize") {
"network_nameservers_test.js", "network_nameservers_test.js",
"network_password_input_test.js", "network_password_input_test.js",
"network_property_list_mojo_test.js", "network_property_list_mojo_test.js",
"network_proxy_exclusions_test.js",
"network_proxy_input_test.js", "network_proxy_input_test.js",
"network_select_test.js", "network_select_test.js",
"network_siminfo_test.js", "network_siminfo_test.js",
......
// Copyright 2020 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.
// clang-format off
// #import 'chrome://os-settings/strings.m.js';
// #import 'chrome://resources/cr_components/chromeos/network/network_proxy_exclusions.m.js';
//
// #import {flush} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js';
// clang-format on
suite('NetworkProxyExclusionsTest', function() {
/** @type {!NetworkProxyExclusions|undefined} */
let proxyExclusions;
setup(function() {
proxyExclusions = document.createElement('network-proxy-exclusions');
document.body.appendChild(proxyExclusions);
Polymer.dom.flush();
});
test('Clear fires proxy-exclusions-change event', function(done) {
proxyExclusions.exclusions = [
'one', 'two', 'three'
];
Polymer.dom.flush();
// Verify that clicking the clear button fires the proxy-exclusions-change
// event and that the item was removed from the exclusions list.
proxyExclusions.addEventListener('proxy-exclusions-change', function() {
assertDeepEquals(proxyExclusions.exclusions, ['two', 'three']);
done();
});
const clearBtn = proxyExclusions.$$('cr-icon-button');
assertTrue(!!clearBtn);
// Simulate pressing clear on the first exclusion list item.
clearBtn.click();
});
});
...@@ -273,7 +273,7 @@ js_type_check("closure_compile_module") { ...@@ -273,7 +273,7 @@ js_type_check("closure_compile_module") {
":network_password_input.m", ":network_password_input.m",
":network_property_list_mojo.m", ":network_property_list_mojo.m",
# ":network_proxy.m", # ":network_proxy.m",
# ":network_proxy_exclusions.m", ":network_proxy_exclusions.m",
":network_proxy_input.m", ":network_proxy_input.m",
":network_select.m", ":network_select.m",
":network_shared_css.m", ":network_shared_css.m",
...@@ -519,7 +519,11 @@ js_library("network_proxy.m") { ...@@ -519,7 +519,11 @@ js_library("network_proxy.m") {
js_library("network_proxy_exclusions.m") { js_library("network_proxy_exclusions.m") {
sources = [ "$root_gen_dir/ui/webui/resources/cr_components/chromeos/network/network_proxy_exclusions.m.js" ] sources = [ "$root_gen_dir/ui/webui/resources/cr_components/chromeos/network/network_proxy_exclusions.m.js" ]
deps = [ deps = [
# TODO: Fill those in. ":network_shared_css.m",
"//third_party/polymer/v3_0/components-chromium/iron-flex-layout:iron-flex-layout-classes",
"//third_party/polymer/v3_0/components-chromium/polymer:polymer_bundled",
"//ui/webui/resources/cr_elements/cr_icon_button:cr_icon_button.m",
"//ui/webui/resources/js:i18n_behavior.m",
] ]
extra_deps = [ ":network_proxy_exclusions_module" ] extra_deps = [ ":network_proxy_exclusions_module" ]
} }
...@@ -732,6 +736,8 @@ polymer_modulizer("network_proxy_exclusions") { ...@@ -732,6 +736,8 @@ polymer_modulizer("network_proxy_exclusions") {
js_file = "network_proxy_exclusions.js" js_file = "network_proxy_exclusions.js"
html_file = "network_proxy_exclusions.html" html_file = "network_proxy_exclusions.html"
html_type = "dom-module" html_type = "dom-module"
auto_imports = cr_components_chromeos_auto_imports
namespace_rewrites = cr_components_chromeos_namespace_rewrites
} }
polymer_modulizer("network_proxy_input") { polymer_modulizer("network_proxy_input") {
......
<link rel="import" href="../../../html/polymer.html"> <link rel="import" href="../../../html/polymer.html">
<link rel="import" href="../../../cr_elements/cr_icon_button/cr_icon_button.html"> <link rel="import" href="chrome://resources/cr_elements/cr_icon_button/cr_icon_button.html">
<link rel="import" href="../../../cr_elements/hidden_style_css.html"> <link rel="import" href="chrome://resources/cr_elements/hidden_style_css.html">
<link rel="import" href="chrome://resources/html/i18n_behavior.html">
<link rel="import" href="chrome://resources/polymer/v1_0/iron-flex-layout/iron-flex-layout-classes.html"> <link rel="import" href="chrome://resources/polymer/v1_0/iron-flex-layout/iron-flex-layout-classes.html">
<link rel="import" href="../../../html/i18n_behavior.html">
<link rel="import" href="network_shared_css.html"> <link rel="import" href="network_shared_css.html">
<dom-module id="network-proxy-exclusions"> <dom-module id="network-proxy-exclusions">
......
...@@ -7,8 +7,6 @@ ...@@ -7,8 +7,6 @@
* Includes UI for adding, changing, and removing entries. * Includes UI for adding, changing, and removing entries.
*/ */
(function() {
Polymer({ Polymer({
is: 'network-proxy-exclusions', is: 'network-proxy-exclusions',
...@@ -45,4 +43,3 @@ Polymer({ ...@@ -45,4 +43,3 @@ Polymer({
this.fire('proxy-exclusions-change'); this.fire('proxy-exclusions-change');
} }
}); });
})();
...@@ -108,6 +108,10 @@ ...@@ -108,6 +108,10 @@
file="${root_gen_dir}/ui/webui/resources/cr_components/chromeos/network/network_property_list_mojo.m.js" file="${root_gen_dir}/ui/webui/resources/cr_components/chromeos/network/network_property_list_mojo.m.js"
use_base_dir="false" use_base_dir="false"
type="BINDATA" /> type="BINDATA" />
<include name="IDR_WEBUI_CHROMEOS_NETWORK_PROXY_EXCLUSIONS_M_JS"
file="${root_gen_dir}/ui/webui/resources/cr_components/chromeos/network/network_proxy_exclusions.m.js"
use_base_dir="false"
type="BINDATA" />
<include name="IDR_WEBUI_CHROMEOS_NETWORK_PROXY_INPUT_M_JS" <include name="IDR_WEBUI_CHROMEOS_NETWORK_PROXY_INPUT_M_JS"
file="${root_gen_dir}/ui/webui/resources/cr_components/chromeos/network/network_proxy_input.m.js" file="${root_gen_dir}/ui/webui/resources/cr_components/chromeos/network/network_proxy_input.m.js"
use_base_dir="false" use_base_dir="false"
......
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