diff options
author | blundell@chromium.org <blundell@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-13 22:23:55 +0000 |
---|---|---|
committer | blundell@chromium.org <blundell@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-13 22:23:55 +0000 |
commit | cdf740538b89917805a0e3717b68203508ac6359 (patch) | |
tree | d5fefec2805e2baeb3dbc92149c6916ee2903dad /sync | |
parent | 499de56eca20067b4ee4c31ea0ed735376d67154 (diff) | |
download | chromium_src-cdf740538b89917805a0e3717b68203508ac6359.zip chromium_src-cdf740538b89917805a0e3717b68203508ac6359.tar.gz chromium_src-cdf740538b89917805a0e3717b68203508ac6359.tar.bz2 |
Bring up minimal sync and sync unittest targets on iOS.
The sync implementation is not yet complete (e.g., there is not yet an
invalidator_factory implementation on iOS), but enough of the structure is in
place to allow for the sync target to build and a reduced set of unittests to
run successfully.
Review URL: https://chromiumcodereview.appspot.com/11360194
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@167485 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sync')
-rw-r--r-- | sync/sync.gyp | 26 | ||||
-rw-r--r-- | sync/util/get_session_name.cc | 4 | ||||
-rw-r--r-- | sync/util/get_session_name_ios.h | 18 | ||||
-rw-r--r-- | sync/util/get_session_name_ios.mm | 19 |
4 files changed, 65 insertions, 2 deletions
diff --git a/sync/sync.gyp b/sync/sync.gyp index 3f75837..6172b84 100644 --- a/sync/sync.gyp +++ b/sync/sync.gyp @@ -222,6 +222,8 @@ 'util/extensions_activity_monitor.h', 'util/get_session_name.cc', 'util/get_session_name.h', + 'util/get_session_name_ios.mm', + 'util/get_session_name_ios.h', 'util/get_session_name_mac.mm', 'util/get_session_name_mac.h', 'util/get_session_name_win.cc', @@ -273,7 +275,12 @@ 'notifier/object_id_invalidation_map.h', ], 'conditions': [ - ['OS != "android"', { + ['OS == "ios"', { + 'sources!': [ + 'notifier/invalidator_factory.cc', + ], + }], + ['OS != "android" and OS != "ios"', { 'sources': [ 'notifier/ack_tracker.cc', 'notifier/ack_tracker.h', @@ -695,7 +702,15 @@ 'notifier/invalidator_factory_unittest.cc', ], 'conditions': [ - ['OS != "android"', { + ['OS == "ios"', { + 'sources!': [ + # TODO(ios): Re-enable this test on iOS once there is an iOS + # implementation of invalidator_factory. + 'notifier/invalidator_factory_unittest.cc', + 'notifier/sync_notifier_factory_unittest.cc', + ], + }], + ['OS != "android" and OS != "ios"', { 'sources': [ 'notifier/ack_tracker_unittest.cc', 'notifier/fake_invalidator_unittest.cc', @@ -773,6 +788,13 @@ 'internal_api/sync_encryption_handler_impl_unittest.cc', 'internal_api/sync_manager_impl_unittest.cc', ], + 'conditions': [ + ['OS == "ios"', { + 'sources!': [ + 'internal_api/http_bridge_unittest.cc', + ], + }], + ], }, }, diff --git a/sync/util/get_session_name.cc b/sync/util/get_session_name.cc index 3eede5a..244aa14 100644 --- a/sync/util/get_session_name.cc +++ b/sync/util/get_session_name.cc @@ -15,6 +15,8 @@ #include "chrome/browser/chromeos/system/statistics_provider.h" #elif defined(OS_LINUX) #include "base/linux_util.h" +#elif defined(OS_IOS) +#include "sync/util/get_session_name_ios.h" #elif defined(OS_MACOSX) #include "sync/util/get_session_name_mac.h" #elif defined(OS_WIN) @@ -44,6 +46,8 @@ std::string GetSessionNameSynchronously() { session_name = board.substr(0, 6) == "stumpy" ? "Chromebox" : "Chromebook"; #elif defined(OS_LINUX) session_name = base::GetLinuxDistro(); +#elif defined(OS_IOS) + session_name = internal::GetComputerName(); #elif defined(OS_MACOSX) session_name = internal::GetHardwareModelName(); #elif defined(OS_WIN) diff --git a/sync/util/get_session_name_ios.h b/sync/util/get_session_name_ios.h new file mode 100644 index 0000000..15e7e98 --- /dev/null +++ b/sync/util/get_session_name_ios.h @@ -0,0 +1,18 @@ +// Copyright 2012 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. + +#ifndef SYNC_UTIL_GET_SESSION_NAME_IOS_H_ +#define SYNC_UTIL_GET_SESSION_NAME_IOS_H_ + +#include <string> + +namespace syncer { +namespace internal { + +std::string GetComputerName(); + +} // namespace internal +} // namespace syncer + +#endif // SYNC_UTIL_GET_SESSION_NAME_IOS_H_ diff --git a/sync/util/get_session_name_ios.mm b/sync/util/get_session_name_ios.mm new file mode 100644 index 0000000..f9c101b --- /dev/null +++ b/sync/util/get_session_name_ios.mm @@ -0,0 +1,19 @@ +// Copyright 2012 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 "sync/util/get_session_name_ios.h" + +#import <UIKit/UIKit.h> + +#include "base/sys_string_conversions.h" + +namespace syncer { +namespace internal { + +std::string GetComputerName() { + return base::SysNSStringToUTF8([[UIDevice currentDevice] name]); +} + +} // namespace internal +} // namespace syncer |