| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ash/public/cpp/shell_window_ids.h" |
| 5 #include "base/auto_reset.h" | 6 #include "base/auto_reset.h" |
| 6 #include "chrome/browser/chromeos/bluetooth/bluetooth_pairing_dialog.h" | 7 #include "chrome/browser/chromeos/bluetooth/bluetooth_pairing_dialog.h" |
| 7 #include "chrome/browser/ui/browser.h" | |
| 8 #include "chrome/browser/ui/browser_window.h" | |
| 9 #include "chrome/test/base/web_ui_browser_test.h" | 8 #include "chrome/test/base/web_ui_browser_test.h" |
| 10 #include "content/public/browser/web_ui.h" | 9 #include "content/public/browser/web_ui.h" |
| 11 #include "content/public/test/browser_test_utils.h" | 10 #include "content/public/test/browser_test_utils.h" |
| 12 #include "device/bluetooth/bluetooth_adapter_factory.h" | 11 #include "device/bluetooth/bluetooth_adapter_factory.h" |
| 13 #include "device/bluetooth/test/mock_bluetooth_adapter.h" | 12 #include "device/bluetooth/test/mock_bluetooth_adapter.h" |
| 14 #include "device/bluetooth/test/mock_bluetooth_device.h" | 13 #include "device/bluetooth/test/mock_bluetooth_device.h" |
| 15 #include "extensions/browser/extension_function.h" | 14 #include "extensions/browser/extension_function.h" |
| 16 #include "testing/gmock/include/gmock/gmock.h" | 15 #include "testing/gmock/include/gmock/gmock.h" |
| 17 | 16 |
| 18 class BluetoothPairingUITest : public WebUIBrowserTest { | 17 class BluetoothPairingUITest : public WebUIBrowserTest { |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 0, | 50 0, |
| 52 "Bluetooth 2.0 Mouse", | 51 "Bluetooth 2.0 Mouse", |
| 53 "28:CF:DA:00:00:00", | 52 "28:CF:DA:00:00:00", |
| 54 kNotPaired, | 53 kNotPaired, |
| 55 kNotConnected)); | 54 kNotConnected)); |
| 56 | 55 |
| 57 EXPECT_CALL(*mock_adapter_, GetDevice(testing::_)) | 56 EXPECT_CALL(*mock_adapter_, GetDevice(testing::_)) |
| 58 .WillOnce(testing::Return(mock_device_.get())); | 57 .WillOnce(testing::Return(mock_device_.get())); |
| 59 | 58 |
| 60 chromeos::BluetoothPairingDialog* dialog = | 59 chromeos::BluetoothPairingDialog* dialog = |
| 61 new chromeos::BluetoothPairingDialog( | 60 new chromeos::BluetoothPairingDialog(mock_device_.get()); |
| 62 browser()->window()->GetNativeWindow(), mock_device_.get()); | 61 dialog->ShowInContainer(ash::kShellWindowId_SystemModalContainer); |
| 63 dialog->Show(); | |
| 64 | 62 |
| 65 content::WebUI* webui = dialog->GetWebUIForTest(); | 63 content::WebUI* webui = dialog->GetWebUIForTest(); |
| 66 content::WebContents* webui_webcontents = webui->GetWebContents(); | 64 content::WebContents* webui_webcontents = webui->GetWebContents(); |
| 67 content::WaitForLoadStop(webui_webcontents); | 65 content::WaitForLoadStop(webui_webcontents); |
| 68 SetWebUIInstance(webui); | 66 SetWebUIInstance(webui); |
| 69 } | 67 } |
| OLD | NEW |