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

Side by Side Diff: chrome/browser/extensions/api/notification/notification_apitest.cc

Issue 12335024: Change eventTime field to standard chrome.* API format. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/browser/extensions/api/notification/notification_api.h" 5 #include "chrome/browser/extensions/api/notification/notification_api.h"
6 #include "chrome/browser/extensions/extension_apitest.h" 6 #include "chrome/browser/extensions/extension_apitest.h"
7 #include "chrome/browser/extensions/extension_function_test_utils.h" 7 #include "chrome/browser/extensions/extension_function_test_utils.h"
8 #include "chrome/common/chrome_switches.h" 8 #include "chrome/common/chrome_switches.h"
9 9
10 using extensions::Extension; 10 using extensions::Extension;
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 scoped_ptr<base::Value> result(utils::RunFunctionAndReturnSingleResult( 164 scoped_ptr<base::Value> result(utils::RunFunctionAndReturnSingleResult(
165 notification_create_function, 165 notification_create_function,
166 "[\"\", " 166 "[\"\", "
167 "{" 167 "{"
168 "\"templateType\": \"basic\"," 168 "\"templateType\": \"basic\","
169 "\"iconUrl\": \"http://www.google.com/intl/en/chrome/assets/" 169 "\"iconUrl\": \"http://www.google.com/intl/en/chrome/assets/"
170 "common/images/chrome_logo_2x.png\"," 170 "common/images/chrome_logo_2x.png\","
171 "\"title\": \"Attention!\"," 171 "\"title\": \"Attention!\","
172 "\"message\": \"Check out Cirque du Soleil\"," 172 "\"message\": \"Check out Cirque du Soleil\","
173 "\"priority\": 1," 173 "\"priority\": 1,"
174 "\"eventTime\": \"Tue, 15 Nov 1994 12:45:26 GMT\"," 174 "\"eventTime\": 1234567890.12345678,"
175 "\"buttons\": [" 175 "\"buttons\": ["
176 " {" 176 " {"
177 " \"title\": \"Up\"," 177 " \"title\": \"Up\","
178 " \"iconUrl\":\"http://www.google.com/logos/2012/\"" 178 " \"iconUrl\":\"http://www.google.com/logos/2012/\""
179 " }," 179 " },"
180 " {" 180 " {"
181 " \"title\": \"Down\"" // note: no iconUrl 181 " \"title\": \"Down\"" // note: no iconUrl
182 " }" 182 " }"
183 "]," 183 "],"
184 "\"expandedMessage\": \"This is a longer expanded message.\"," 184 "\"expandedMessage\": \"This is a longer expanded message.\","
(...skipping 30 matching lines...) Expand all
215 " {\"title\": \"Carla Coe\"," 215 " {\"title\": \"Carla Coe\","
216 " \"message\": \"Just took a look at the proposal\"}," 216 " \"message\": \"Just took a look at the proposal\"},"
217 " {\"title\": \"Donna Doe\"," 217 " {\"title\": \"Donna Doe\","
218 " \"message\": \"I see that you went to the conference\"}," 218 " \"message\": \"I see that you went to the conference\"},"
219 " {\"title\": \"Frank Foe\"," 219 " {\"title\": \"Frank Foe\","
220 " \"message\": \"I ate Harry's sandwich!\"}," 220 " \"message\": \"I ate Harry's sandwich!\"},"
221 " {\"title\": \"Grace Goe\"," 221 " {\"title\": \"Grace Goe\","
222 " \"message\": \"I saw Frank steal a sandwich :-)\"}" 222 " \"message\": \"I saw Frank steal a sandwich :-)\"}"
223 "]," 223 "],"
224 "\"priority\": 1," 224 "\"priority\": 1,"
225 "\"eventTime\": \"Fri, 16 Nov 2012 01:17:15 GMT\"" 225 "\"eventTime\": 1361488019.9999999"
226 "}]", 226 "}]",
227 browser(), utils::NONE)); 227 browser(), utils::NONE));
228 // TODO(dharcourt): [...], items = [{title: foo, message: bar}, ...], [...] 228 // TODO(dharcourt): [...], items = [{title: foo, message: bar}, ...], [...]
229 229
230 std::string notification_id; 230 std::string notification_id;
231 ASSERT_EQ(base::Value::TYPE_STRING, result->GetType()); 231 ASSERT_EQ(base::Value::TYPE_STRING, result->GetType());
232 ASSERT_TRUE(result->GetAsString(&notification_id)); 232 ASSERT_TRUE(result->GetAsString(&notification_id));
233 ASSERT_TRUE(notification_id.length() > 0); 233 ASSERT_TRUE(notification_id.length() > 0);
234 } 234 }
235 235
236 IN_PROC_BROWSER_TEST_F(NotificationApiTest, TestEvents) { 236 IN_PROC_BROWSER_TEST_F(NotificationApiTest, TestEvents) {
237 ASSERT_TRUE(RunExtensionTest("notification/api/events")) << message_; 237 ASSERT_TRUE(RunExtensionTest("notification/api/events")) << message_;
238 } 238 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698