Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(96)

Unified Diff: chrome/test/data/webui/settings/bluetooth_page_tests.js

Issue 2801403002: MD Settings: Bluetooth: Fix adapter state and discovery (Closed)
Patch Set: Use CHECK instead of early exit Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/test/data/webui/settings/bluetooth_page_tests.js
diff --git a/chrome/test/data/webui/settings/bluetooth_page_tests.js b/chrome/test/data/webui/settings/bluetooth_page_tests.js
index 820f84c4bf45e9f5a01109f5d66bd5f39eb15132..5644558e3480eda192c2907fa5d2261b6fbc8b30 100644
--- a/chrome/test/data/webui/settings/bluetooth_page_tests.js
+++ b/chrome/test/data/webui/settings/bluetooth_page_tests.js
@@ -72,38 +72,41 @@ suite('Bluetooth', function() {
});
test('MainPage', function() {
- assertFalse(bluetoothApi_.adapterState.powered);
- assertFalse(bluetoothPage.bluetoothEnabled_);
+ assertFalse(bluetoothApi_.getAdapterStateForTest().powered);
+ assertFalse(bluetoothPage.bluetoothToggleState_);
// Test that tapping the single settings-box div enables bluetooth.
var div = bluetoothPage.$$('div.settings-box');
assertTrue(!!div);
MockInteractions.tap(div);
- assertTrue(bluetoothPage.bluetoothEnabled_);
- assertTrue(bluetoothApi_.adapterState.powered);
+ assertTrue(bluetoothPage.bluetoothToggleState_);
+ assertTrue(bluetoothApi_.getAdapterStateForTest().powered);
});
suite('SubPage', function() {
var subpage;
setup(function() {
- bluetoothPage.bluetoothEnabled_ = true;
+ bluetoothApi_.setEnabled(true);
+ Polymer.dom.flush();
var div = bluetoothPage.$$('div.settings-box');
MockInteractions.tap(div);
subpage = bluetoothPage.$$('settings-bluetooth-subpage');
assertTrue(!!subpage);
+ assertTrue(subpage.bluetoothToggleState);
+ assertFalse(subpage.bluetoothToggleDisabled);
});
test('toggle', function() {
- assertTrue(subpage.bluetoothEnabled);
+ assertTrue(subpage.bluetoothToggleState);
var enableButton = subpage.$.enableBluetooth;
assertTrue(!!enableButton);
assertTrue(enableButton.checked);
- subpage.bluetoothEnabled = false;
+ subpage.bluetoothToggleState = false;
assertFalse(enableButton.checked);
- assertFalse(bluetoothApi_.adapterState.powered);;
- assertFalse(bluetoothPage.bluetoothEnabled_);
+ assertFalse(bluetoothApi_.getAdapterStateForTest().powered);
+ assertFalse(bluetoothPage.bluetoothToggleState_);
});
test('paired device list', function() {

Powered by Google App Engine
This is Rietveld 408576698