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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/bluetooth/bluetooth_service_record_unittest.cc
diff --git a/chrome/browser/chromeos/bluetooth/bluetooth_service_record_unittest.cc b/chrome/browser/chromeos/bluetooth/bluetooth_service_record_unittest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..5172ccc41a87c7cbb8c727d28782e9bd38c655e0
--- /dev/null
+++ b/chrome/browser/chromeos/bluetooth/bluetooth_service_record_unittest.cc
@@ -0,0 +1,45 @@
+// Copyright (c) 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 <string>
+
+#include "base/file_path.h"
+#include "base/file_util.h"
+#include "base/path_service.h"
+#include "chrome/browser/chromeos/bluetooth/bluetooth_service_record.h"
+#include "chrome/common/chrome_paths.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace {
+
+static const char* kAddress = "01:02:03:04:05:06";
+
+} // namespace
+
+namespace chromeos {
+
+class BluetoothServiceRecordTest : public testing::Test {
+ public:
+ FilePath GetTestDataFilePath(const char* file) {
+ FilePath path;
+ PathService::Get(chrome::DIR_TEST_DATA, &path);
+ path = path.AppendASCII("chromeos");
+ path = path.AppendASCII("bluetooth");
+ path = path.AppendASCII(file);
+ return path;
+ }
+};
+
+TEST_F(BluetoothServiceRecordTest, RfcommService) {
+ std::string xml_data;
+ file_util::ReadFileToString(GetTestDataFilePath("rfcomm.xml"), &xml_data);
+
+ BluetoothServiceRecord service_record(kAddress, xml_data);
+ EXPECT_EQ(kAddress, service_record.address());
+ EXPECT_EQ("Headset Audio Gateway", service_record.name());
+ EXPECT_TRUE(service_record.SupportsRfcomm());
+ EXPECT_EQ((uint8_t)12, service_record.rfcomm_channel());
+}
+
+} // namespace chromeos
« 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