Commit d6ebbae4 authored by James Hawkins's avatar James Hawkins Committed by Commit Bot

OS Settings: Convert CellularSetupDialog to Polymer 3.

R=khorimoto@chromium.org

Bug: 1045266
Test: OSSettingsCellularSetupDialog*
Change-Id: I8da974e120b534be54f454580c23f55f2632d395
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2422319
Commit-Queue: James Hawkins <jhawkins@chromium.org>
Reviewed-by: default avatarKyle Horimoto <khorimoto@chromium.org>
Cr-Commit-Position: refs/heads/master@{#809653}
parent c7f5eebe
...@@ -180,7 +180,7 @@ js_library("cellular_setup_dialog") { ...@@ -180,7 +180,7 @@ js_library("cellular_setup_dialog") {
js_type_check("closure_compile_module") { js_type_check("closure_compile_module") {
is_polymer3 = true is_polymer3 = true
deps = [ deps = [
# ":cellular_setup_dialog.m" ":cellular_setup_dialog.m",
# ":internet_config.m", # ":internet_config.m",
# ":internet_detail_page.m", # ":internet_detail_page.m",
":internet_known_networks_page.m", ":internet_known_networks_page.m",
...@@ -195,6 +195,17 @@ js_type_check("closure_compile_module") { ...@@ -195,6 +195,17 @@ js_type_check("closure_compile_module") {
] ]
} }
js_library("cellular_setup_dialog.m") {
sources = [ "$root_gen_dir/chrome/browser/resources/settings/chromeos/internet_page/cellular_setup_dialog.m.js" ]
deps = [
"//third_party/polymer/v3_0/components-chromium/polymer:polymer_bundled",
"//ui/webui/resources/cr_components/chromeos/cellular_setup:cellular_setup.m",
"//ui/webui/resources/cr_elements/cr_dialog:cr_dialog.m",
"//ui/webui/resources/js:i18n_behavior.m",
]
extra_deps = [ ":cellular_setup_dialog_module" ]
}
js_library("internet_config.m") { js_library("internet_config.m") {
sources = [ "$root_gen_dir/chrome/browser/resources/settings/chromeos/internet_page/internet_config.m.js" ] sources = [ "$root_gen_dir/chrome/browser/resources/settings/chromeos/internet_page/internet_config.m.js" ]
deps = [ deps = [
...@@ -293,14 +304,6 @@ js_library("tether_connection_dialog.m") { ...@@ -293,14 +304,6 @@ js_library("tether_connection_dialog.m") {
extra_deps = [ ":tether_connection_dialog_module" ] extra_deps = [ ":tether_connection_dialog_module" ]
} }
js_library("cellular_setup_dialog.m") {
sources = [ "$root_gen_dir/chrome/browser/resources/settings/chromeos/internet_page/cellular_setup_dialog.m.js" ]
deps = [
# TODO: Fill those in.
]
extra_deps = [ ":cellular_setup_dialog_module" ]
}
import("//tools/polymer/polymer.gni") import("//tools/polymer/polymer.gni")
group("polymer3_elements") { group("polymer3_elements") {
......
...@@ -3,6 +3,8 @@ ...@@ -3,6 +3,8 @@
<link rel="import" href="chrome://resources/cr_components/chromeos/cellular_setup/cellular_setup.html"> <link rel="import" href="chrome://resources/cr_components/chromeos/cellular_setup/cellular_setup.html">
<link rel="import" href="chrome://resources/cr_elements/cr_dialog/cr_dialog.html"> <link rel="import" href="chrome://resources/cr_elements/cr_dialog/cr_dialog.html">
<link rel="import" href="chrome://resources/cr_elements/shared_vars_css.html"> <link rel="import" href="chrome://resources/cr_elements/shared_vars_css.html">
<link rel="import" href="chrome://resources/html/i18n_behavior.html">
<link rel="import" href="../../settings_shared_css.html">
<dom-module id="os-settings-cellular-setup-dialog"> <dom-module id="os-settings-cellular-setup-dialog">
<template> <template>
......
...@@ -7,6 +7,7 @@ import './localized_link/localized_link.m.js'; ...@@ -7,6 +7,7 @@ import './localized_link/localized_link.m.js';
import './bluetooth_page/bluetooth_page.m.js'; import './bluetooth_page/bluetooth_page.m.js';
import './bluetooth_page/bluetooth_subpage.m.js'; import './bluetooth_page/bluetooth_subpage.m.js';
import './bluetooth_page/bluetooth_device_list_item.m.js'; import './bluetooth_page/bluetooth_device_list_item.m.js';
import './internet_page/cellular_setup_dialog.m.js';
import './internet_page/internet_known_networks_page.m.js'; import './internet_page/internet_known_networks_page.m.js';
import './nearby_share_page/nearby_share_receive_dialog.m.js'; import './nearby_share_page/nearby_share_receive_dialog.m.js';
import './nearby_share_page/nearby_share_subpage.m.js'; import './nearby_share_page/nearby_share_subpage.m.js';
......
...@@ -30,6 +30,11 @@ ...@@ -30,6 +30,11 @@
use_base_dir="false" use_base_dir="false"
compress="false" compress="false"
type="BINDATA" /> type="BINDATA" />
<include name="IDR_OS_SETTINGS_CELLULAR_SETUP_DIALOG_M_JS"
file="${root_gen_dir}/chrome/browser/resources/settings/chromeos/internet_page/cellular_setup_dialog.m.js"
use_base_dir="false"
compress="false"
type="BINDATA" />
<include name="IDR_OS_SETTINGS_INTERNET_KNOWN_NETWORKS_PAGE_M_JS" <include name="IDR_OS_SETTINGS_INTERNET_KNOWN_NETWORKS_PAGE_M_JS"
file="${root_gen_dir}/chrome/browser/resources/settings/chromeos/internet_page/internet_known_networks_page.m.js" file="${root_gen_dir}/chrome/browser/resources/settings/chromeos/internet_page/internet_known_networks_page.m.js"
use_base_dir="false" use_base_dir="false"
......
...@@ -283,6 +283,7 @@ if (include_js_tests) { ...@@ -283,6 +283,7 @@ if (include_js_tests) {
"$root_gen_dir/chrome/test/data/webui/nearby_share/shared/nearby_visibility_page_test.m.js", "$root_gen_dir/chrome/test/data/webui/nearby_share/shared/nearby_visibility_page_test.m.js",
"$root_gen_dir/chrome/test/data/webui/settings/chromeos/ambient_mode_page_test.m.js", "$root_gen_dir/chrome/test/data/webui/settings/chromeos/ambient_mode_page_test.m.js",
"$root_gen_dir/chrome/test/data/webui/settings/chromeos/bluetooth_page_tests.m.js", "$root_gen_dir/chrome/test/data/webui/settings/chromeos/bluetooth_page_tests.m.js",
"$root_gen_dir/chrome/test/data/webui/settings/chromeos/cellular_setup_dialog_test.m.js",
"$root_gen_dir/chrome/test/data/webui/settings/chromeos/date_time_page_tests.m.js", "$root_gen_dir/chrome/test/data/webui/settings/chromeos/date_time_page_tests.m.js",
"$root_gen_dir/chrome/test/data/webui/settings/chromeos/fake_bluetooth_private.m.js", "$root_gen_dir/chrome/test/data/webui/settings/chromeos/fake_bluetooth_private.m.js",
"$root_gen_dir/chrome/test/data/webui/settings/chromeos/fake_bluetooth.m.js", "$root_gen_dir/chrome/test/data/webui/settings/chromeos/fake_bluetooth.m.js",
......
...@@ -33,6 +33,7 @@ js_modulizer("modulize") { ...@@ -33,6 +33,7 @@ js_modulizer("modulize") {
input_files = [ input_files = [
"ambient_mode_page_test.js", "ambient_mode_page_test.js",
"bluetooth_page_tests.js", "bluetooth_page_tests.js",
"cellular_setup_dialog_test.js",
"date_time_page_tests.js", "date_time_page_tests.js",
"fake_bluetooth.js", "fake_bluetooth.js",
"fake_bluetooth_private.js", "fake_bluetooth_private.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/chromeos/os_settings.js';
// #import {flush} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js';
// clang-format on
suite('CellularSetupDialog', function() {
test('Dialog opened on attach', function(done) {
/** @type {!OsSettingsCellularSetupDialog} */
const cellularSetupDialog =
document.createElement('os-settings-cellular-setup-dialog');
// Verify the dialog is opened.
cellularSetupDialog.addEventListener('cr-dialog-open', function(e) {
done();
});
// Attach the element to the DOM, which opens the dialog.
document.body.appendChild(cellularSetupDialog);
Polymer.dom.flush();
assertTrue(cellularSetupDialog.$.dialog.open);
});
});
...@@ -864,6 +864,37 @@ TEST_F( ...@@ -864,6 +864,37 @@ TEST_F(
mocha.run(); mocha.run();
}); });
// Test fixture for settings-internet-known-networks-page.
// eslint-disable-next-line no-var
var OSSettingsCellularSetupDialogTest =
class extends OSSettingsBrowserTest {
/** @override */
get browsePreload() {
return super.browsePreload;/* +
'chromeos/internet_page/cellular_setup_dialog.html';*/
}
/** @override */
get featureList() {
return {enabled: ['chromeos::features::kUpdatedCellularActivationUi']};
}
/** @override */
get extraLibraries() {
return super.extraLibraries.concat([
'//ui/webui/resources/js/assert.js',
BROWSER_SETTINGS_PATH + '../test_util.js',
'cellular_setup_dialog_test.js',
]);
}
};
TEST_F(
'OSSettingsCellularSetupDialogTest', 'CellularSetupDialog',
() => {
mocha.run();
});
// Test fixture for the main settings page. // Test fixture for the main settings page.
// eslint-disable-next-line no-var // eslint-disable-next-line no-var
var OSSettingsMainTest = class extends OSSettingsBrowserTest { var OSSettingsMainTest = class extends OSSettingsBrowserTest {
......
...@@ -32,6 +32,7 @@ var OSSettingsV3BrowserTest = class extends PolymerTest { ...@@ -32,6 +32,7 @@ var OSSettingsV3BrowserTest = class extends PolymerTest {
return { return {
enabled: [ enabled: [
'chromeos::features::kOsSettingsPolymer3', 'chromeos::features::kOsSettingsPolymer3',
'chromeos::features::kUpdatedCellularActivationUi',
], ],
}; };
} }
...@@ -92,6 +93,7 @@ TEST_F('OSSettingsNearbyShareSubPageV3Test', 'All', () => mocha.run()); ...@@ -92,6 +93,7 @@ TEST_F('OSSettingsNearbyShareSubPageV3Test', 'All', () => mocha.run());
[['AmbientModePage', 'ambient_mode_page_test.m.js'], [['AmbientModePage', 'ambient_mode_page_test.m.js'],
['BluetoothPage', 'bluetooth_page_tests.m.js'], ['BluetoothPage', 'bluetooth_page_tests.m.js'],
['CellularSetupDialog', 'cellular_setup_dialog_test.m.js'],
['DateTimePage', 'date_time_page_tests.m.js'], ['DateTimePage', 'date_time_page_tests.m.js'],
['InputMethodOptionPage', 'input_method_options_page_test.m.js'], ['InputMethodOptionPage', 'input_method_options_page_test.m.js'],
['InternetKnownNetworksPage', 'internet_known_networks_page_tests.m.js'], ['InternetKnownNetworksPage', 'internet_known_networks_page_tests.m.js'],
......
...@@ -140,9 +140,17 @@ preprocess_grit("preprocess_generated") { ...@@ -140,9 +140,17 @@ preprocess_grit("preprocess_generated") {
in_files += [ in_files += [
"cr_components/chromeos/bluetooth/bluetooth_dialog.m.js", "cr_components/chromeos/bluetooth/bluetooth_dialog.m.js",
"cr_components/chromeos/cellular_setup/base_page.m.js", "cr_components/chromeos/cellular_setup/base_page.m.js",
"cr_components/chromeos/cellular_setup/button_bar.m.js",
"cr_components/chromeos/cellular_setup/cellular_setup.m.js",
"cr_components/chromeos/cellular_setup/cellular_types.m.js",
"cr_components/chromeos/cellular_setup/esim_flow_ui.m.js",
"cr_components/chromeos/cellular_setup/final_page.m.js", "cr_components/chromeos/cellular_setup/final_page.m.js",
"cr_components/chromeos/cellular_setup/mojo_interface_provider.m.js", "cr_components/chromeos/cellular_setup/mojo_interface_provider.m.js",
"cr_components/chromeos/cellular_setup/provisioning_page.m.js",
"cr_components/chromeos/cellular_setup/psim_flow_ui.m.js",
"cr_components/chromeos/cellular_setup/setup_selection_flow.m.js",
"cr_components/chromeos/cellular_setup/sim_detect_page.m.js", "cr_components/chromeos/cellular_setup/sim_detect_page.m.js",
"cr_components/chromeos/cellular_setup/subflow_behavior.m.js",
"cr_components/chromeos/cellular_setup/webview_post_util.m.js", "cr_components/chromeos/cellular_setup/webview_post_util.m.js",
"cr_components/chromeos/network/cr_policy_network_behavior_mojo.m.js", "cr_components/chromeos/network/cr_policy_network_behavior_mojo.m.js",
"cr_components/chromeos/network/cr_policy_network_indicator_mojo.m.js", "cr_components/chromeos/network/cr_policy_network_indicator_mojo.m.js",
......
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