OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/file_path.h" | 7 #include "base/file_path.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
10 #include "chrome/browser/chromeos/bluetooth/bluetooth_service_record.h" | |
11 #include "chrome/common/chrome_paths.h" | 10 #include "chrome/common/chrome_paths.h" |
keybuk
2012/10/08 17:21:59
You can't include chrome/ from device/
youngki
2012/10/09 14:37:54
This is necessary to set the path to test xml data
keybuk
2012/10/10 01:16:32
it doesn't matter how necessary it is - it's illeg
youngki
2012/10/10 14:44:34
Okay I will migrate the part of ChromeTestSuite in
youngki
2012/10/10 18:34:56
DeviceTestSuite added and this include has been re
| |
11 #include "device/bluetooth/bluetooth_service_record.h" | |
12 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
13 | 13 |
14 namespace { | 14 namespace { |
15 | 15 |
16 static const char* kAddress = "01:02:03:04:05:06"; | 16 static const char* kAddress = "01:02:03:04:05:06"; |
17 static const char* kCustomUuid = "01234567-89ab-cdef-0123-456789abcdef"; | 17 static const char* kCustomUuid = "01234567-89ab-cdef-0123-456789abcdef"; |
18 static const char* kSerialUuid = "00001101-0000-1000-8000-00805f9b34fb"; | 18 static const char* kSerialUuid = "00001101-0000-1000-8000-00805f9b34fb"; |
19 | 19 |
20 } // namespace | 20 } // namespace |
21 | 21 |
22 namespace chromeos { | 22 namespace device_bluetooth { |
23 | 23 |
24 class BluetoothServiceRecordTest : public testing::Test { | 24 class BluetoothServiceRecordTest : public testing::Test { |
25 public: | 25 public: |
26 FilePath GetTestDataFilePath(const char* file) { | 26 FilePath GetTestDataFilePath(const char* file) { |
27 FilePath path; | 27 FilePath path; |
28 PathService::Get(chrome::DIR_TEST_DATA, &path); | 28 PathService::Get(chrome::DIR_TEST_DATA, &path); |
29 path = path.AppendASCII("chromeos"); | 29 path = path.AppendASCII("chromeos"); |
30 path = path.AppendASCII("bluetooth"); | 30 path = path.AppendASCII("bluetooth"); |
31 path = path.AppendASCII(file); | 31 path = path.AppendASCII(file); |
32 return path; | 32 return path; |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
65 BluetoothServiceRecord service_record(kAddress, xml_data); | 65 BluetoothServiceRecord service_record(kAddress, xml_data); |
66 EXPECT_EQ(kCustomUuid, service_record.uuid()); | 66 EXPECT_EQ(kCustomUuid, service_record.uuid()); |
67 | 67 |
68 xml_data.clear(); | 68 xml_data.clear(); |
69 file_util::ReadFileToString(GetTestDataFilePath("invalid_uuid.xml"), | 69 file_util::ReadFileToString(GetTestDataFilePath("invalid_uuid.xml"), |
70 &xml_data); | 70 &xml_data); |
71 BluetoothServiceRecord invalid_service_record(kAddress, xml_data); | 71 BluetoothServiceRecord invalid_service_record(kAddress, xml_data); |
72 EXPECT_EQ("", invalid_service_record.uuid()); | 72 EXPECT_EQ("", invalid_service_record.uuid()); |
73 } | 73 } |
74 | 74 |
75 } // namespace chromeos | 75 } // namespace device_bluetooth |
OLD | NEW |