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