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

Side by Side Diff: content/browser/geolocation/wifi_data_provider_chromeos_unittest.cc

Issue 2192683003: Revert of Reland: Geolocation: move from content/browser to device/ (patchset #2 id:20001 of https:… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2810
Patch Set: Created 4 years, 4 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "base/message_loop/message_loop.h"
6 #include "base/run_loop.h" 5 #include "base/run_loop.h"
7 #include "base/strings/string_number_conversions.h" 6 #include "base/strings/string_number_conversions.h"
8 #include "base/strings/stringprintf.h" 7 #include "base/strings/stringprintf.h"
9 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
10 #include "chromeos/dbus/dbus_thread_manager.h" 9 #include "chromeos/dbus/dbus_thread_manager.h"
11 #include "chromeos/dbus/shill_manager_client.h" 10 #include "chromeos/dbus/shill_manager_client.h"
12 #include "chromeos/network/geolocation_handler.h" 11 #include "chromeos/network/geolocation_handler.h"
13 #include "device/geolocation/wifi_data_provider_chromeos.h" 12 #include "content/browser/geolocation/wifi_data_provider_chromeos.h"
13 #include "content/public/test/test_browser_thread_bundle.h"
14 #include "testing/gtest/include/gtest/gtest.h" 14 #include "testing/gtest/include/gtest/gtest.h"
15 #include "third_party/cros_system_api/dbus/service_constants.h" 15 #include "third_party/cros_system_api/dbus/service_constants.h"
16 16
17 namespace device { 17 namespace content {
18 18
19 class GeolocationChromeOsWifiDataProviderTest : public testing::Test { 19 class GeolocationChromeOsWifiDataProviderTest : public testing::Test {
20 protected: 20 protected:
21 GeolocationChromeOsWifiDataProviderTest() { 21 GeolocationChromeOsWifiDataProviderTest() {
22 } 22 }
23 23
24 void SetUp() override { 24 void SetUp() override {
25 chromeos::DBusThreadManager::Initialize(); 25 chromeos::DBusThreadManager::Initialize();
26 chromeos::NetworkHandler::Initialize(); 26 chromeos::NetworkHandler::Initialize();
27 manager_client_ = 27 manager_client_ =
(...skipping 27 matching lines...) Expand all
55 properties.SetStringWithoutPathExpansion( 55 properties.SetStringWithoutPathExpansion(
56 shill::kGeoChannelProperty, channel); 56 shill::kGeoChannelProperty, channel);
57 properties.SetStringWithoutPathExpansion( 57 properties.SetStringWithoutPathExpansion(
58 shill::kGeoSignalStrengthProperty, strength); 58 shill::kGeoSignalStrengthProperty, strength);
59 manager_test_->AddGeoNetwork(shill::kTypeWifi, properties); 59 manager_test_->AddGeoNetwork(shill::kTypeWifi, properties);
60 } 60 }
61 } 61 }
62 base::RunLoop().RunUntilIdle(); 62 base::RunLoop().RunUntilIdle();
63 } 63 }
64 64
65 base::MessageLoopForUI message_loop_; 65 TestBrowserThreadBundle thread_bundle_;
66 scoped_refptr<WifiDataProviderChromeOs> provider_; 66 scoped_refptr<WifiDataProviderChromeOs> provider_;
67 chromeos::ShillManagerClient* manager_client_; 67 chromeos::ShillManagerClient* manager_client_;
68 chromeos::ShillManagerClient::TestInterface* manager_test_; 68 chromeos::ShillManagerClient::TestInterface* manager_test_;
69 WifiData::AccessPointDataSet ap_data_; 69 WifiData::AccessPointDataSet ap_data_;
70 }; 70 };
71 71
72 TEST_F(GeolocationChromeOsWifiDataProviderTest, NoAccessPoints) { 72 TEST_F(GeolocationChromeOsWifiDataProviderTest, NoAccessPoints) {
73 base::RunLoop().RunUntilIdle(); 73 base::RunLoop().RunUntilIdle();
74 // Initial call to GetAccessPointData requests data and will return false. 74 // Initial call to GetAccessPointData requests data and will return false.
75 EXPECT_FALSE(GetAccessPointData()); 75 EXPECT_FALSE(GetAccessPointData());
(...skipping 16 matching lines...) Expand all
92 92
93 TEST_F(GeolocationChromeOsWifiDataProviderTest, GetManyAccessPoints) { 93 TEST_F(GeolocationChromeOsWifiDataProviderTest, GetManyAccessPoints) {
94 base::RunLoop().RunUntilIdle(); 94 base::RunLoop().RunUntilIdle();
95 EXPECT_FALSE(GetAccessPointData()); 95 EXPECT_FALSE(GetAccessPointData());
96 96
97 AddAccessPoints(3, 4); 97 AddAccessPoints(3, 4);
98 EXPECT_TRUE(GetAccessPointData()); 98 EXPECT_TRUE(GetAccessPointData());
99 ASSERT_EQ(12u, ap_data_.size()); 99 ASSERT_EQ(12u, ap_data_.size());
100 } 100 }
101 101
102 } // namespace device 102 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/geolocation/wifi_data_provider_chromeos.cc ('k') | content/browser/geolocation/wifi_data_provider_common.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698