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

Side by Side Diff: chrome/browser/chromeos/bluetooth/bluetooth_service_record_unittest.cc

Issue 10007008: Add support for creating bluetooth RFCOMM sockets. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase diff to exclude extensions code Created 8 years, 8 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) 2012 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 <string>
6
7 #include "base/file_path.h"
8 #include "base/file_util.h"
9 #include "base/path_service.h"
10 #include "chrome/browser/chromeos/bluetooth/bluetooth_service_record.h"
11 #include "chrome/common/chrome_paths.h"
12 #include "testing/gtest/include/gtest/gtest.h"
13
14 namespace {
15
16 static const char* kAddress = "01:02:03:04:05:06";
17
18 } // namespace
19
20 namespace chromeos {
21
22 class BluetoothServiceRecordTest : public testing::Test {
23 public:
24 FilePath GetTestDataFilePath(const char* file) {
25 FilePath path;
26 PathService::Get(chrome::DIR_TEST_DATA, &path);
27 path = path.AppendASCII("chromeos");
28 path = path.AppendASCII("bluetooth");
29 path = path.AppendASCII(file);
30 return path;
31 }
32 };
33
34 TEST_F(BluetoothServiceRecordTest, RfcommService) {
35 std::string xml_data;
36 file_util::ReadFileToString(GetTestDataFilePath("rfcomm.xml"), &xml_data);
37
38 BluetoothServiceRecord service_record(kAddress, xml_data);
39 EXPECT_EQ(kAddress, service_record.address());
40 EXPECT_EQ("Headset Audio Gateway", service_record.name());
41 EXPECT_TRUE(service_record.SupportsRfcomm());
42 EXPECT_EQ((uint8_t)12, service_record.rfcomm_channel());
43 }
44
45 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/bluetooth/bluetooth_service_record.cc ('k') | chrome/browser/chromeos/bluetooth/bluetooth_socket.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698