OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 <stddef.h> |
| 6 #include <stdint.h> |
| 7 |
5 #include "base/callback.h" | 8 #include "base/callback.h" |
6 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
7 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
8 #include "base/run_loop.h" | 11 #include "base/run_loop.h" |
9 #include "base/values.h" | 12 #include "base/values.h" |
10 #include "chromeos/dbus/dbus_thread_manager.h" | 13 #include "chromeos/dbus/dbus_thread_manager.h" |
11 #include "chromeos/dbus/fake_nfc_adapter_client.h" | 14 #include "chromeos/dbus/fake_nfc_adapter_client.h" |
12 #include "chromeos/dbus/fake_nfc_device_client.h" | 15 #include "chromeos/dbus/fake_nfc_device_client.h" |
13 #include "chromeos/dbus/fake_nfc_record_client.h" | 16 #include "chromeos/dbus/fake_nfc_record_client.h" |
14 #include "chromeos/dbus/fake_nfc_tag_client.h" | 17 #include "chromeos/dbus/fake_nfc_tag_client.h" |
(...skipping 734 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
749 EXPECT_TRUE(result.GetDouble(nfc_record::kSizeProperty, &double_value)); | 752 EXPECT_TRUE(result.GetDouble(nfc_record::kSizeProperty, &double_value)); |
750 EXPECT_EQ(kSize, double_value); | 753 EXPECT_EQ(kSize, double_value); |
751 } | 754 } |
752 | 755 |
753 TEST_F(NfcChromeOSTest, RecordPropertiesToNfcNdefRecord) { | 756 TEST_F(NfcChromeOSTest, RecordPropertiesToNfcNdefRecord) { |
754 const char kText[] = "text"; | 757 const char kText[] = "text"; |
755 const char kURI[] = "test://uri"; | 758 const char kURI[] = "test://uri"; |
756 const char kEncoding[] = "encoding"; | 759 const char kEncoding[] = "encoding"; |
757 const char kLanguageCode[] = "en"; | 760 const char kLanguageCode[] = "en"; |
758 const char kMimeType[] = "mime-type"; | 761 const char kMimeType[] = "mime-type"; |
759 const uint32 kSize = 5; | 762 const uint32_t kSize = 5; |
760 | 763 |
761 FakeNfcRecordClient::Properties record_properties( | 764 FakeNfcRecordClient::Properties record_properties( |
762 base::Bind(&OnPropertyChangedCallback)); | 765 base::Bind(&OnPropertyChangedCallback)); |
763 | 766 |
764 // Text record. | 767 // Text record. |
765 record_properties.type.ReplaceValue(nfc_record::kTypeText); | 768 record_properties.type.ReplaceValue(nfc_record::kTypeText); |
766 record_properties.representation.ReplaceValue(kText); | 769 record_properties.representation.ReplaceValue(kText); |
767 record_properties.language.ReplaceValue(kLanguageCode); | 770 record_properties.language.ReplaceValue(kLanguageCode); |
768 record_properties.encoding.ReplaceValue(kEncoding); | 771 record_properties.encoding.ReplaceValue(kEncoding); |
769 | 772 |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
849 EXPECT_TRUE(title->GetString(NfcNdefRecord::kFieldText, &string_value)); | 852 EXPECT_TRUE(title->GetString(NfcNdefRecord::kFieldText, &string_value)); |
850 EXPECT_EQ(kText, string_value); | 853 EXPECT_EQ(kText, string_value); |
851 EXPECT_TRUE(title->GetString( | 854 EXPECT_TRUE(title->GetString( |
852 NfcNdefRecord::kFieldLanguageCode, &string_value)); | 855 NfcNdefRecord::kFieldLanguageCode, &string_value)); |
853 EXPECT_EQ(kLanguageCode, string_value); | 856 EXPECT_EQ(kLanguageCode, string_value); |
854 EXPECT_TRUE(title->GetString(NfcNdefRecord::kFieldEncoding, &string_value)); | 857 EXPECT_TRUE(title->GetString(NfcNdefRecord::kFieldEncoding, &string_value)); |
855 EXPECT_EQ(kEncoding, string_value); | 858 EXPECT_EQ(kEncoding, string_value); |
856 } | 859 } |
857 | 860 |
858 } // namespace chromeos | 861 } // namespace chromeos |
OLD | NEW |