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 "chrome/common/web_apps.h" | 5 #include "chrome/common/web_apps.h" |
6 | 6 |
7 #include "base/file_path.h" | 7 #include "base/file_path.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/json/json_file_value_serializer.h" | 9 #include "base/json/json_file_value_serializer.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 EXPECT_EQ("http://example.com/16.png", web_app->icons[0].url.spec()); | 127 EXPECT_EQ("http://example.com/16.png", web_app->icons[0].url.spec()); |
128 EXPECT_EQ(16, web_app->icons[0].width); | 128 EXPECT_EQ(16, web_app->icons[0].width); |
129 EXPECT_EQ(16, web_app->icons[0].height); | 129 EXPECT_EQ(16, web_app->icons[0].height); |
130 ASSERT_EQ(2u, web_app->urls.size()); | 130 ASSERT_EQ(2u, web_app->urls.size()); |
131 EXPECT_EQ("http://example.com/foobar", web_app->urls[0].spec()); | 131 EXPECT_EQ("http://example.com/foobar", web_app->urls[0].spec()); |
132 EXPECT_EQ("http://example.com/baz", web_app->urls[1].spec()); | 132 EXPECT_EQ("http://example.com/baz", web_app->urls[1].spec()); |
133 ASSERT_EQ(2u, web_app->permissions.size()); | 133 ASSERT_EQ(2u, web_app->permissions.size()); |
134 EXPECT_EQ("geolocation", web_app->permissions[0]); | 134 EXPECT_EQ("geolocation", web_app->permissions[0]); |
135 EXPECT_EQ("notifications", web_app->permissions[1]); | 135 EXPECT_EQ("notifications", web_app->permissions[1]); |
136 EXPECT_EQ("panel", web_app->launch_container); | 136 EXPECT_EQ("panel", web_app->launch_container); |
| 137 EXPECT_EQ(true, web_app->is_offline_enabled); |
137 } | 138 } |
138 | 139 |
139 // Tests ParseIconSizes with various input. | 140 // Tests ParseIconSizes with various input. |
140 TEST(WebAppInfo, ParseIconSizes) { | 141 TEST(WebAppInfo, ParseIconSizes) { |
141 struct TestData { | 142 struct TestData { |
142 const char* input; | 143 const char* input; |
143 const bool expected_result; | 144 const bool expected_result; |
144 const bool is_any; | 145 const bool is_any; |
145 const size_t expected_size_count; | 146 const size_t expected_size_count; |
146 const int width1; | 147 const int width1; |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 ASSERT_EQ(data[i].width1, sizes[0].width()); | 183 ASSERT_EQ(data[i].width1, sizes[0].width()); |
183 ASSERT_EQ(data[i].height1, sizes[0].height()); | 184 ASSERT_EQ(data[i].height1, sizes[0].height()); |
184 } | 185 } |
185 if (sizes.size() > 1) { | 186 if (sizes.size() > 1) { |
186 ASSERT_EQ(data[i].width2, sizes[1].width()); | 187 ASSERT_EQ(data[i].width2, sizes[1].width()); |
187 ASSERT_EQ(data[i].height2, sizes[1].height()); | 188 ASSERT_EQ(data[i].height2, sizes[1].height()); |
188 } | 189 } |
189 } | 190 } |
190 } | 191 } |
191 } | 192 } |
OLD | NEW |