-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CrOS Settings: Convert tether_connection_dialog browser test to TS
Bug: b:270728282 Test: browser_tests --gtest_filter="OSSettingsInternetPageTetherConnectionDialog*" Change-Id: I3183d5f5ccbdc1992131771192b61b47d5db8088 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4342530 Reviewed-by: Wes Okuhara <wesokuhara@google.com> Commit-Queue: Ilkin Safarli <safarli@google.com> Cr-Commit-Position: refs/heads/main@{#1117828}
- Loading branch information
Ilkin Safarli
authored and
Chromium LUCI CQ
committed
Mar 15, 2023
1 parent
8c68836
commit 87362ae
Showing
5 changed files
with
39 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
chrome/test/data/webui/settings/chromeos/internet_page/tether_connection_dialog_test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// Copyright 2020 The Chromium Authors | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
import 'chrome://os-settings/chromeos/lazy_load.js'; | ||
|
||
import {TetherConnectionDialogElement} from 'chrome://os-settings/chromeos/lazy_load.js'; | ||
import {OncMojo} from 'chrome://resources/ash/common/network/onc_mojo.js'; | ||
import {flush} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; | ||
import {assertEquals} from 'chrome://webui-test/chai_assert.js'; | ||
|
||
suite('<tether-connection-dialog>', function() { | ||
let tetherDialog: TetherConnectionDialogElement; | ||
|
||
setup(function() { | ||
tetherDialog = document.createElement('tether-connection-dialog'); | ||
document.body.appendChild(tetherDialog); | ||
flush(); | ||
}); | ||
|
||
test('Battery percentage', function() { | ||
const managedProperties = OncMojo.getDefaultManagedProperties( | ||
OncMojo.getNetworkTypeFromString('Tether'), 'guid', 'name'); | ||
managedProperties.typeProperties.tether!.batteryPercentage = 75; | ||
tetherDialog.managedProperties = managedProperties; | ||
flush(); | ||
|
||
const batteryEl = tetherDialog.shadowRoot!.querySelector<HTMLElement>( | ||
'#hostDeviceTextBattery'); | ||
assertEquals('75% Battery', batteryEl!.innerText.trim()); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 0 additions & 36 deletions
36
chrome/test/data/webui/settings/chromeos/tether_connection_dialog_test.js
This file was deleted.
Oops, something went wrong.