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

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

Issue 6597044: Revert 76228 - Move core pieces of geolocation from chrome to content.This is... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "base/threading/platform_thread.h"
6 #include "content/browser/geolocation/device_data_provider.h"
7 #include "content/browser/geolocation/wifi_data_provider_common.h"
8 #include "testing/gtest/include/gtest/gtest.h"
9
10 namespace {
11
12 class NullWifiDataListenerInterface
13 : public WifiDataProviderCommon::ListenerInterface {
14 public:
15 // ListenerInterface
16 virtual void DeviceDataUpdateAvailable(
17 DeviceDataProvider<WifiData>* provider) {}
18 };
19
20 TEST(GeolocationDeviceDataProviderWifiData, CreateDestroy) {
21 // See http://crbug.com/59913 . The main_message_loop is not required to be
22 // run for correct behaviour, but we run it in this test to help smoke out
23 // any race conditions between processing in the main loop and the setup /
24 // tear down of the DeviceDataProvider thread.
25 MessageLoopForUI main_message_loop;
26 NullWifiDataListenerInterface listener;
27 for (int i = 0; i < 10; i++) {
28 DeviceDataProvider<WifiData>::Register(&listener);
29 for (int j = 0; j < 10; j++) {
30 base::PlatformThread::Sleep(0);
31 main_message_loop.RunAllPending(); // See comment above
32 }
33 DeviceDataProvider<WifiData>::Unregister(&listener);
34 for (int j = 0; j < 10; j++) {
35 base::PlatformThread::Sleep(0);
36 main_message_loop.RunAllPending(); // See comment above
37 }
38 }
39 }
40
41 } // namespace
OLDNEW
« no previous file with comments | « content/browser/geolocation/device_data_provider.cc ('k') | content/browser/geolocation/empty_device_data_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698