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

Side by Side Diff: chrome/browser/services/gcm/push_messaging_browsertest.cc

Issue 793403002: Implement WebPushProvider.unregister() in Chromium. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mvan_2
Patch Set: browsertests and override fix Created 6 years 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 <map> 5 #include <map>
6 #include <string> 6 #include <string>
7 7
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after
403 EXPECT_EQ("permission status - denied", script_result); 403 EXPECT_EQ("permission status - denied", script_result);
404 404
405 ASSERT_TRUE(RunScript("registerPush()", &script_result)); 405 ASSERT_TRUE(RunScript("registerPush()", &script_result));
406 EXPECT_EQ("AbortError - Registration failed - permission denied", 406 EXPECT_EQ("AbortError - Registration failed - permission denied",
407 script_result); 407 script_result);
408 408
409 ASSERT_TRUE(RunScript("hasPermission()", &script_result)); 409 ASSERT_TRUE(RunScript("hasPermission()", &script_result));
410 EXPECT_EQ("permission status - denied", script_result); 410 EXPECT_EQ("permission status - denied", script_result);
411 } 411 }
412 412
413 IN_PROC_BROWSER_TEST_F(PushMessagingBrowserTest, Unregister) {
414 std::string script_result;
415
416 ASSERT_TRUE(RunScript("registerServiceWorker()", &script_result));
417 ASSERT_EQ("ok - service worker registered", script_result);
418
419 InfoBarResponder accepting_responder(browser(), true);
420 ASSERT_TRUE(RunScript("requestNotificationPermission();", &script_result));
421 EXPECT_EQ("permission status - granted", script_result);
422
423 ASSERT_TRUE(RunScript("registerPush()", &script_result));
424 EXPECT_EQ(std::string(kPushMessagingEndpoint) + " - 1", script_result);
425
426 ASSERT_TRUE(RunScript("unregister()", &script_result));
427 EXPECT_EQ("unregister result: true", script_result);
428 }
429
413 } // namespace gcm 430 } // namespace gcm
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698