OLD | NEW |
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/barrier_closure.h" | 8 #include "base/barrier_closure.h" |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 } // namespace | 70 } // namespace |
71 | 71 |
72 class PushMessagingBrowserTest : public InProcessBrowserTest { | 72 class PushMessagingBrowserTest : public InProcessBrowserTest { |
73 public: | 73 public: |
74 PushMessagingBrowserTest() : gcm_service_(nullptr) {} | 74 PushMessagingBrowserTest() : gcm_service_(nullptr) {} |
75 ~PushMessagingBrowserTest() override {} | 75 ~PushMessagingBrowserTest() override {} |
76 | 76 |
77 // InProcessBrowserTest: | 77 // InProcessBrowserTest: |
78 void SetUpCommandLine(base::CommandLine* command_line) override { | 78 void SetUpCommandLine(base::CommandLine* command_line) override { |
79 command_line->AppendSwitch(switches::kEnablePushMessagePayload); | 79 command_line->AppendSwitch(switches::kEnablePushMessagePayload); |
80 command_line->AppendSwitch(switches::kEnablePushMessagingHasPermission); | |
81 | 80 |
82 InProcessBrowserTest::SetUpCommandLine(command_line); | 81 InProcessBrowserTest::SetUpCommandLine(command_line); |
83 } | 82 } |
84 | 83 |
85 // InProcessBrowserTest: | 84 // InProcessBrowserTest: |
86 void SetUp() override { | 85 void SetUp() override { |
87 https_server_.reset(new net::SpawnedTestServer( | 86 https_server_.reset(new net::SpawnedTestServer( |
88 net::SpawnedTestServer::TYPE_HTTPS, | 87 net::SpawnedTestServer::TYPE_HTTPS, |
89 net::BaseTestServer::SSLOptions( | 88 net::BaseTestServer::SSLOptions( |
90 net::BaseTestServer::SSLOptions::CERT_OK), | 89 net::BaseTestServer::SSLOptions::CERT_OK), |
(...skipping 1006 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1097 std::string script_result; | 1096 std::string script_result; |
1098 | 1097 |
1099 ASSERT_TRUE(RunScript("registerServiceWorker()", &script_result)); | 1098 ASSERT_TRUE(RunScript("registerServiceWorker()", &script_result)); |
1100 ASSERT_EQ("ok - service worker registered", script_result); | 1099 ASSERT_EQ("ok - service worker registered", script_result); |
1101 | 1100 |
1102 // In Incognito mode the promise returned by getSubscription should not hang, | 1101 // In Incognito mode the promise returned by getSubscription should not hang, |
1103 // it should just fulfill with null. | 1102 // it should just fulfill with null. |
1104 ASSERT_TRUE(RunScript("hasSubscription()", &script_result)); | 1103 ASSERT_TRUE(RunScript("hasSubscription()", &script_result)); |
1105 ASSERT_EQ("false - not subscribed", script_result); | 1104 ASSERT_EQ("false - not subscribed", script_result); |
1106 } | 1105 } |
OLD | NEW |