Commit 0e4a1ef0 authored by Nnamdi Theodore Johnson-Kanu's avatar Nnamdi Theodore Johnson-Kanu Committed by Commit Bot

[CrOS cellular] Migrate cellular_setup/psim_flow_ui.js to Polymer3

Bug: 1111477
Change-Id: I4604ea00cd12cead7dcff72e2c4f615355320d07
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2375599
Commit-Queue: Nnamdi Theodore Johnson-kanu <tjohnsonkanu@google.com>
Reviewed-by: default avatarKyle Horimoto <khorimoto@chromium.org>
Cr-Commit-Position: refs/heads/master@{#801952}
parent 6e040ba3
...@@ -245,8 +245,9 @@ if (include_js_tests) { ...@@ -245,8 +245,9 @@ if (include_js_tests) {
"$root_gen_dir/chrome/test/data/webui/cr_components/chromeos/cellular_setup/base_page_test.m.js", "$root_gen_dir/chrome/test/data/webui/cr_components/chromeos/cellular_setup/base_page_test.m.js",
"$root_gen_dir/chrome/test/data/webui/cr_components/chromeos/cellular_setup/button_bar_test.m.js", "$root_gen_dir/chrome/test/data/webui/cr_components/chromeos/cellular_setup/button_bar_test.m.js",
"$root_gen_dir/chrome/test/data/webui/cr_components/chromeos/cellular_setup/final_page_test.m.js", "$root_gen_dir/chrome/test/data/webui/cr_components/chromeos/cellular_setup/final_page_test.m.js",
"$root_gen_dir/chrome/test/data/webui/cr_components/chromeos/cellular_setup/sim_detect_page_test.m.js",
"$root_gen_dir/chrome/test/data/webui/cr_components/chromeos/cellular_setup/provisioning_page_test.m.js", "$root_gen_dir/chrome/test/data/webui/cr_components/chromeos/cellular_setup/provisioning_page_test.m.js",
"$root_gen_dir/chrome/test/data/webui/cr_components/chromeos/cellular_setup/psim_flow_ui_test.m.js",
"$root_gen_dir/chrome/test/data/webui/cr_components/chromeos/cellular_setup/sim_detect_page_test.m.js",
"$root_gen_dir/chrome/test/data/webui/cr_components/chromeos/network/cr_policy_network_behavior_mojo_tests.m.js", "$root_gen_dir/chrome/test/data/webui/cr_components/chromeos/network/cr_policy_network_behavior_mojo_tests.m.js",
"$root_gen_dir/chrome/test/data/webui/cr_components/chromeos/network/cr_policy_network_indicator_mojo_tests.m.js", "$root_gen_dir/chrome/test/data/webui/cr_components/chromeos/network/cr_policy_network_indicator_mojo_tests.m.js",
"$root_gen_dir/chrome/test/data/webui/cr_components/chromeos/network/network_apnlist_test.m.js", "$root_gen_dir/chrome/test/data/webui/cr_components/chromeos/network/network_apnlist_test.m.js",
......
...@@ -2,16 +2,17 @@ ...@@ -2,16 +2,17 @@
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
import("//ui/webui/resources/tools/js_modulizer.gni")
import("//ui/webui/resources/cr_components/chromeos/os_cr_components.gni") import("//ui/webui/resources/cr_components/chromeos/os_cr_components.gni")
import("//ui/webui/resources/tools/js_modulizer.gni")
js_modulizer("modulize") { js_modulizer("modulize") {
input_files = [ input_files = [
"base_page_test.js", "base_page_test.js",
"button_bar_test.js", "button_bar_test.js",
"final_page_test.js", "final_page_test.js",
"sim_detect_page_test.js",
"provisioning_page_test.js", "provisioning_page_test.js",
"psim_flow_ui_test.js",
"sim_detect_page_test.js",
] ]
namespace_rewrites = cr_components_chromeos_namespace_rewrites namespace_rewrites = cr_components_chromeos_namespace_rewrites
} }
// 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/cellular_setup/psim_flow_ui.m.js';
// #import {flush, Polymer} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js';
// #import {assertTrue} from '../../../chai_assert.js';
// clang-format on
suite('CrComponentsPsimFlowUiTest', function() {
let pSimPage;
setup(function() {
pSimPage = document.createElement('psim-flow-ui');
document.body.appendChild(pSimPage);
Polymer.dom.flush();
});
test('Base test', function() {
const ironPage = pSimPage.$$('iron-pages');
assertTrue(!!ironPage);
});
});
...@@ -46,6 +46,7 @@ GEN('#include "content/public/test/browser_test.h"'); ...@@ -46,6 +46,7 @@ GEN('#include "content/public/test/browser_test.h"');
['ButtonBar', 'cellular_setup/button_bar_test.js',[]], ['ButtonBar', 'cellular_setup/button_bar_test.js',[]],
['FinalPage', 'cellular_setup/final_page_test.js', []], ['FinalPage', 'cellular_setup/final_page_test.js', []],
['ProvisioningPage', 'cellular_setup/provisioning_page_test.js',[]], ['ProvisioningPage', 'cellular_setup/provisioning_page_test.js',[]],
['PsimFlowUi', 'cellular_setup/psim_flow_ui_test.js',[]],
['SimDetectPage', 'cellular_setup/sim_detect_page_test.js', []], ['SimDetectPage', 'cellular_setup/sim_detect_page_test.js', []],
].forEach(test => registerTest('CellularSetup', 'cellular-setup', ...test)); ].forEach(test => registerTest('CellularSetup', 'cellular-setup', ...test));
// clang-format on // clang-format on
......
...@@ -26,6 +26,7 @@ GEN('#include "chromeos/constants/chromeos_features.h"'); ...@@ -26,6 +26,7 @@ GEN('#include "chromeos/constants/chromeos_features.h"');
['ButtonBar', 'cellular_setup/button_bar_test.m.js'], ['ButtonBar', 'cellular_setup/button_bar_test.m.js'],
['FinalPage', 'cellular_setup/final_page_test.m.js'], ['FinalPage', 'cellular_setup/final_page_test.m.js'],
['ProvisioningPage', 'cellular_setup/provisioning_page_test.m.js'], ['ProvisioningPage', 'cellular_setup/provisioning_page_test.m.js'],
['PsimFlowUi', 'cellular_setup/psim_flow_ui_test.m.js'],
['SimDetectPage', 'cellular_setup/sim_detect_page_test.m.js'], ['SimDetectPage', 'cellular_setup/sim_detect_page_test.m.js'],
].forEach(test => registerTest('CellularSetup', ...test)); ].forEach(test => registerTest('CellularSetup', ...test));
// clang-format on // clang-format on
......
...@@ -70,6 +70,7 @@ js_library("psim_flow_ui") { ...@@ -70,6 +70,7 @@ js_library("psim_flow_ui") {
":sim_detect_page", ":sim_detect_page",
":subflow_behavior", ":subflow_behavior",
"//chromeos/services/cellular_setup/public/mojom:mojom_js_library_for_compile", "//chromeos/services/cellular_setup/public/mojom:mojom_js_library_for_compile",
"//ui/webui/resources/js:assert.m",
"//ui/webui/resources/js:i18n_behavior", "//ui/webui/resources/js:i18n_behavior",
] ]
} }
...@@ -133,8 +134,7 @@ js_type_check("closure_compile_module") { ...@@ -133,8 +134,7 @@ js_type_check("closure_compile_module") {
":final_page.m", ":final_page.m",
":mojo_interface_provider.m", ":mojo_interface_provider.m",
":provisioning_page.m", ":provisioning_page.m",
":psim_flow_ui.m",
# ":psim_flow_ui.m",
":sim_detect_page.m", ":sim_detect_page.m",
":subflow_behavior.m", ":subflow_behavior.m",
...@@ -223,6 +223,24 @@ js_library("subflow_behavior.m") { ...@@ -223,6 +223,24 @@ js_library("subflow_behavior.m") {
extra_deps = [ ":modulize" ] extra_deps = [ ":modulize" ]
} }
js_library("psim_flow_ui.m") {
sources = [ "$root_gen_dir/ui/webui/resources/cr_components/chromeos/cellular_setup/psim_flow_ui.m.js" ]
deps = [
":cellular_types.m",
":cellular_types.m",
":final_page.m",
":mojo_interface_provider.m",
":provisioning_page.m",
":sim_detect_page.m",
":subflow_behavior.m",
"//chromeos/services/cellular_setup/public/mojom:mojom_js_library_for_compile",
"//third_party/polymer/v3_0/components-chromium/polymer:polymer_bundled",
"//ui/webui/resources/js:assert.m",
"//ui/webui/resources/js:i18n_behavior.m",
]
extra_deps = [ ":psim_flow_ui_module" ]
}
group("polymer3_elements") { group("polymer3_elements") {
public_deps = [ public_deps = [
":base_page_module", ":base_page_module",
...@@ -230,6 +248,7 @@ group("polymer3_elements") { ...@@ -230,6 +248,7 @@ group("polymer3_elements") {
":final_page_module", ":final_page_module",
":modulize", ":modulize",
":provisioning_page_module", ":provisioning_page_module",
":psim_flow_ui_module",
":sim_detect_page_module", ":sim_detect_page_module",
] ]
} }
...@@ -274,6 +293,14 @@ polymer_modulizer("provisioning_page") { ...@@ -274,6 +293,14 @@ polymer_modulizer("provisioning_page") {
auto_imports = cr_components_chromeos_auto_imports auto_imports = cr_components_chromeos_auto_imports
} }
polymer_modulizer("psim_flow_ui") {
js_file = "psim_flow_ui.js"
html_file = "psim_flow_ui.html"
html_type = "dom-module"
namespace_rewrites = cr_components_chromeos_namespace_rewrites
auto_imports = cr_components_chromeos_auto_imports
}
js_modulizer("modulize") { js_modulizer("modulize") {
input_files = [ input_files = [
"cellular_types.js", "cellular_types.js",
......
...@@ -6,10 +6,13 @@ ...@@ -6,10 +6,13 @@
<link rel="import" href="provisioning_page.html"> <link rel="import" href="provisioning_page.html">
<link rel="import" href="final_page.html"> <link rel="import" href="final_page.html">
<link rel="import" href="subflow_behavior.html"> <link rel="import" href="subflow_behavior.html">
<link rel="import" href="cellular_types.html">
<link rel="import" href="chrome://resources/html/assert.html">
<link rel="import" href="chrome://resources/polymer/v1_0/iron-flex-layout/iron-flex-layout.html"> <link rel="import" href="chrome://resources/polymer/v1_0/iron-flex-layout/iron-flex-layout.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="chrome://resources/polymer/v1_0/iron-pages/iron-pages.html"> <link rel="import" href="chrome://resources/polymer/v1_0/iron-pages/iron-pages.html">
<dom-module id="psim-flow-ui"> <dom-module id="psim-flow-ui">
<template> <template>
<style include="iron-flex"> <style include="iron-flex">
...@@ -31,6 +34,5 @@ ...@@ -31,6 +34,5 @@
<final-page show-error="[[showError_]]"></final-page> <final-page show-error="[[showError_]]"></final-page>
</iron-pages> </iron-pages>
</template> </template>
<script src="psim_flow_ui.js"> <script src="psim_flow_ui.js"></script>
</script>
</dom-module> </dom-module>
...@@ -14,11 +14,16 @@ cr_components_chromeos_namespace_rewrites = [ ...@@ -14,11 +14,16 @@ cr_components_chromeos_namespace_rewrites = [
"cellularSetup.Button|Button", "cellularSetup.Button|Button",
"cellularSetup.ButtonBarState|ButtonBarState", "cellularSetup.ButtonBarState|ButtonBarState",
"cellularSetup.CellularSetupPageName|CellularSetupPageName", "cellularSetup.CellularSetupPageName|CellularSetupPageName",
"cellularSetup.PSimPageName|PSimPageName",
"cellularSetup.PSimUIState|PSimUIState",
"cellularSetup.getTimeoutMsForPSimUIState|getTimeoutMsForPSimUIState",
] ]
cr_components_chromeos_auto_imports = [ cr_components_chromeos_auto_imports = [
"ui/webui/resources/cr_elements/policy/cr_policy_indicator_behavior.html|CrPolicyIndicatorType", "ui/webui/resources/cr_elements/policy/cr_policy_indicator_behavior.html|CrPolicyIndicatorType",
"ui/webui/resources/cr_components/chromeos/cellular_setup/cellular_types.html|ButtonState,Button,ButtonBarState,CellularSetupPageName", "ui/webui/resources/cr_components/chromeos/cellular_setup/cellular_types.html|ButtonState,Button,ButtonBarState,CellularSetupPageName",
"ui/webui/resources/cr_components/chromeos/cellular_setup/subflow_behavior.html|SubflowBehavior",
"ui/webui/resources/cr_components/chromeos/cellular_setup/mojo_interface_provider.html|MojoInterfaceProviderImpl,MojoInterfaceProvider",
"ui/webui/resources/cr_components/chromeos/network/cr_policy_network_behavior_mojo.html|CrPolicyNetworkBehaviorMojo", "ui/webui/resources/cr_components/chromeos/network/cr_policy_network_behavior_mojo.html|CrPolicyNetworkBehaviorMojo",
"ui/webui/resources/cr_components/chromeos/network/onc_mojo.html|OncMojo", "ui/webui/resources/cr_components/chromeos/network/onc_mojo.html|OncMojo",
"ui/webui/resources/cr_components/chromeos/network/network_listener_behavior.html|NetworkListenerBehavior", "ui/webui/resources/cr_components/chromeos/network/network_listener_behavior.html|NetworkListenerBehavior",
......
...@@ -156,6 +156,14 @@ ...@@ -156,6 +156,14 @@
file="${root_gen_dir}/ui/webui/resources/cr_components/chromeos/cellular_setup/cellular_types.m.js" file="${root_gen_dir}/ui/webui/resources/cr_components/chromeos/cellular_setup/cellular_types.m.js"
use_base_dir="false" use_base_dir="false"
type="BINDATA" /> type="BINDATA" />
<include name="IDR_WEBUI_CHROMEOS_CELLULAR_SETUP_SUBFLOW_BEHAVIOR_M_JS"
file="${root_gen_dir}/ui/webui/resources/cr_components/chromeos/cellular_setup/subflow_behavior.m.js"
use_base_dir="false"
type="BINDATA" />
<include name="IDR_WEBUI_CHROMEOS_CELLULAR_SETUP_PSIM_FLOW_UI_M_JS"
file="${root_gen_dir}/ui/webui/resources/cr_components/chromeos/cellular_setup/psim_flow_ui.m.js"
use_base_dir="false"
type="BINDATA" />
</if> </if>
<if expr="use_nss_certs"> <if expr="use_nss_certs">
<include name="IDR_WEBUI_CA_TRUST_EDIT_DIALOG_JS" <include name="IDR_WEBUI_CA_TRUST_EDIT_DIALOG_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