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

Unified Diff: chrome/browser/ui/ash/tray_bluetooth_helper_unittest.cc

Issue 2764643003: cros: Move TrayBluetoothHelper out of chrome into ash (Closed)
Patch Set: rebase fix Created 3 years, 9 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
« no previous file with comments | « chrome/browser/ui/ash/tray_bluetooth_helper.cc ('k') | chrome/test/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/ash/tray_bluetooth_helper_unittest.cc
diff --git a/chrome/browser/ui/ash/tray_bluetooth_helper_unittest.cc b/chrome/browser/ui/ash/tray_bluetooth_helper_unittest.cc
deleted file mode 100644
index f0a47b0a485a28ca007c9bd886c532a24d65458d..0000000000000000000000000000000000000000
--- a/chrome/browser/ui/ash/tray_bluetooth_helper_unittest.cc
+++ /dev/null
@@ -1,60 +0,0 @@
-// Copyright 2017 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.
-
-#include "chrome/browser/ui/ash/tray_bluetooth_helper.h"
-
-#include <vector>
-
-#include "ash/common/system/tray/system_tray_delegate.h"
-#include "ash/test/ash_test_base.h"
-#include "device/bluetooth/dbus/bluez_dbus_manager.h"
-#include "device/bluetooth/dbus/fake_bluetooth_adapter_client.h"
-
-using bluez::BluezDBusManager;
-using bluez::FakeBluetoothAdapterClient;
-
-using TrayBluetoothHelperTest = ash::test::AshTestBase;
-
-// Tests basic functionality like turning Bluetooth on and off.
-TEST_F(TrayBluetoothHelperTest, Basics) {
- // Set Bluetooth discovery simulation delay to 0 so the test doesn't have to
- // wait or use timers.
- FakeBluetoothAdapterClient* adapter_client =
- static_cast<FakeBluetoothAdapterClient*>(
- BluezDBusManager::Get()->GetBluetoothAdapterClient());
- adapter_client->SetSimulationIntervalMs(0);
-
- TrayBluetoothHelper helper;
- helper.Initialize();
- RunAllPendingInMessageLoop();
- EXPECT_TRUE(helper.GetAvailable());
- EXPECT_FALSE(helper.GetEnabled());
- EXPECT_FALSE(helper.HasDiscoverySession());
- EXPECT_FALSE(helper.IsDiscovering());
-
- std::vector<ash::BluetoothDeviceInfo> devices;
- helper.GetAvailableDevices(&devices);
- // The devices are fake in tests, so don't assume any particular number.
- EXPECT_FALSE(devices.empty());
-
- // Turn Bluetooth on.
- helper.ToggleEnabled();
- RunAllPendingInMessageLoop();
- EXPECT_TRUE(helper.GetEnabled());
-
- helper.StartDiscovering();
- RunAllPendingInMessageLoop();
- EXPECT_TRUE(helper.HasDiscoverySession());
- EXPECT_TRUE(helper.IsDiscovering());
-
- helper.StopDiscovering();
- RunAllPendingInMessageLoop();
- EXPECT_FALSE(helper.HasDiscoverySession());
- EXPECT_FALSE(helper.IsDiscovering());
-
- // Turn Bluetooth off.
- helper.ToggleEnabled();
- RunAllPendingInMessageLoop();
- EXPECT_FALSE(helper.GetEnabled());
-}
« no previous file with comments | « chrome/browser/ui/ash/tray_bluetooth_helper.cc ('k') | chrome/test/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698