OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 <string> | 5 #include <string> |
6 | 6 |
7 #include "base/guid.h" | 7 #include "base/guid.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/memory/scoped_vector.h" | 9 #include "base/memory/scoped_vector.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
11 #include "chrome/browser/extensions/api/signed_in_devices/id_mapping_helper.h" | 11 #include "chrome/browser/extensions/api/signed_in_devices/id_mapping_helper.h" |
12 #include "chrome/browser/sync/glue/device_info.h" | 12 #include "components/sync_driver/device_info.h" |
13 #include "testing/gmock/include/gmock/gmock.h" | 13 #include "testing/gmock/include/gmock/gmock.h" |
14 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
15 | 15 |
16 using browser_sync::DeviceInfo; | 16 using sync_driver::DeviceInfo; |
17 | 17 |
18 namespace extensions { | 18 namespace extensions { |
19 bool VerifyDictionary( | 19 bool VerifyDictionary( |
20 const std::string& path, | 20 const std::string& path, |
21 const std::string& expected_value, | 21 const std::string& expected_value, |
22 const base::DictionaryValue& dictionary) { | 22 const base::DictionaryValue& dictionary) { |
23 std::string out; | 23 std::string out; |
24 if (dictionary.GetString(path, &out)) { | 24 if (dictionary.GetString(path, &out)) { |
25 return (out == expected_value); | 25 return (out == expected_value); |
26 } | 26 } |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 EXPECT_NE(public_id3, public_id2); | 78 EXPECT_NE(public_id3, public_id2); |
79 | 79 |
80 // Verify the dictionary. | 80 // Verify the dictionary. |
81 EXPECT_TRUE(VerifyDictionary(public_id1, devices[0]->guid(), dictionary)); | 81 EXPECT_TRUE(VerifyDictionary(public_id1, devices[0]->guid(), dictionary)); |
82 EXPECT_TRUE(VerifyDictionary(public_id2, devices[1]->guid(), dictionary)); | 82 EXPECT_TRUE(VerifyDictionary(public_id2, devices[1]->guid(), dictionary)); |
83 EXPECT_TRUE(VerifyDictionary(public_id3, devices[2]->guid(), dictionary)); | 83 EXPECT_TRUE(VerifyDictionary(public_id3, devices[2]->guid(), dictionary)); |
84 | 84 |
85 EXPECT_EQ(dictionary.size(), 3U); | 85 EXPECT_EQ(dictionary.size(), 3U); |
86 } | 86 } |
87 } // namespace extensions | 87 } // namespace extensions |
OLD | NEW |