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/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
8 #include "googleurl/src/gurl.h" | 8 #include "googleurl/src/gurl.h" |
9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
10 #include "webkit/glue/web_intent_reply_data.h" | 10 #include "webkit/glue/web_intent_reply_data.h" |
11 | 11 |
12 using webkit_glue::WebIntentReply; | 12 using webkit_glue::WebIntentReply; |
13 | 13 |
14 namespace { | 14 namespace { |
15 | 15 |
16 TEST(WebIntentReplyDataTest, DefaultValues) { | 16 TEST(WebIntentReplyDataTest, DefaultValues) { |
17 WebIntentReply reply; | 17 WebIntentReply reply; |
18 EXPECT_EQ(webkit_glue::WEB_INTENT_REPLY_INVALID, reply.type); | 18 EXPECT_EQ(webkit_glue::WEB_INTENT_REPLY_INVALID, reply.type); |
19 EXPECT_EQ(string16(), reply.data); | 19 EXPECT_EQ(string16(), reply.data); |
20 EXPECT_EQ(FilePath(), reply.data_file); | 20 EXPECT_EQ(base::FilePath(), reply.data_file); |
21 EXPECT_EQ(-1, reply.data_file_size); | 21 EXPECT_EQ(-1, reply.data_file_size); |
22 } | 22 } |
23 | 23 |
24 TEST(WebIntentReplyDataTest, Equality) { | 24 TEST(WebIntentReplyDataTest, Equality) { |
25 WebIntentReply data_a( | 25 WebIntentReply data_a( |
26 webkit_glue::WEB_INTENT_REPLY_SUCCESS, | 26 webkit_glue::WEB_INTENT_REPLY_SUCCESS, |
27 ASCIIToUTF16("poodles")); | 27 ASCIIToUTF16("poodles")); |
28 | 28 |
29 WebIntentReply data_b( | 29 WebIntentReply data_b( |
30 webkit_glue::WEB_INTENT_REPLY_SUCCESS, | 30 webkit_glue::WEB_INTENT_REPLY_SUCCESS, |
31 ASCIIToUTF16("poodles")); | 31 ASCIIToUTF16("poodles")); |
32 | 32 |
33 WebIntentReply data_c( | 33 WebIntentReply data_c( |
34 webkit_glue::WEB_INTENT_REPLY_SUCCESS, | 34 webkit_glue::WEB_INTENT_REPLY_SUCCESS, |
35 ASCIIToUTF16("hamfancy")); | 35 ASCIIToUTF16("hamfancy")); |
36 | 36 |
37 EXPECT_EQ(data_a, data_b); | 37 EXPECT_EQ(data_a, data_b); |
38 EXPECT_FALSE(data_a == data_c || data_b == data_c); | 38 EXPECT_FALSE(data_a == data_c || data_b == data_c); |
39 | 39 |
40 WebIntentReply file_a( | 40 WebIntentReply file_a( |
41 webkit_glue::WEB_INTENT_REPLY_SUCCESS, | 41 webkit_glue::WEB_INTENT_REPLY_SUCCESS, |
42 FilePath(), | 42 base::FilePath(), |
43 22); | 43 22); |
44 | 44 |
45 WebIntentReply file_b( | 45 WebIntentReply file_b( |
46 webkit_glue::WEB_INTENT_REPLY_SUCCESS, | 46 webkit_glue::WEB_INTENT_REPLY_SUCCESS, |
47 FilePath(), | 47 base::FilePath(), |
48 22); | 48 22); |
49 | 49 |
50 WebIntentReply file_c( | 50 WebIntentReply file_c( |
51 webkit_glue::WEB_INTENT_REPLY_SUCCESS, | 51 webkit_glue::WEB_INTENT_REPLY_SUCCESS, |
52 FilePath(), | 52 base::FilePath(), |
53 17); | 53 17); |
54 | 54 |
55 EXPECT_EQ(file_a, file_b); | 55 EXPECT_EQ(file_a, file_b); |
56 EXPECT_FALSE(file_a == file_c || file_b == file_c); | 56 EXPECT_FALSE(file_a == file_c || file_b == file_c); |
57 } | 57 } |
58 | 58 |
59 } // namespace | 59 } // namespace |
OLD | NEW |