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/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 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 } // namespace | 160 } // namespace |
161 | 161 |
162 class PushMessagingBrowserTest : public InProcessBrowserTest { | 162 class PushMessagingBrowserTest : public InProcessBrowserTest { |
163 public: | 163 public: |
164 PushMessagingBrowserTest() : gcm_service_(nullptr) {} | 164 PushMessagingBrowserTest() : gcm_service_(nullptr) {} |
165 ~PushMessagingBrowserTest() override {} | 165 ~PushMessagingBrowserTest() override {} |
166 | 166 |
167 // InProcessBrowserTest: | 167 // InProcessBrowserTest: |
168 void SetUpCommandLine(base::CommandLine* command_line) override { | 168 void SetUpCommandLine(base::CommandLine* command_line) override { |
169 command_line->AppendSwitch(switches::kEnablePushMessagePayload); | 169 command_line->AppendSwitch(switches::kEnablePushMessagePayload); |
| 170 command_line->AppendSwitch(switches::kEnablePushMessagingHasPermission); |
| 171 |
170 InProcessBrowserTest::SetUpCommandLine(command_line); | 172 InProcessBrowserTest::SetUpCommandLine(command_line); |
171 } | 173 } |
172 | 174 |
173 // InProcessBrowserTest: | 175 // InProcessBrowserTest: |
174 void SetUp() override { | 176 void SetUp() override { |
175 https_server_.reset(new net::SpawnedTestServer( | 177 https_server_.reset(new net::SpawnedTestServer( |
176 net::SpawnedTestServer::TYPE_HTTPS, | 178 net::SpawnedTestServer::TYPE_HTTPS, |
177 net::BaseTestServer::SSLOptions( | 179 net::BaseTestServer::SSLOptions( |
178 net::BaseTestServer::SSLOptions::CERT_OK), | 180 net::BaseTestServer::SSLOptions::CERT_OK), |
179 base::FilePath(FILE_PATH_LITERAL("chrome/test/data/")))); | 181 base::FilePath(FILE_PATH_LITERAL("chrome/test/data/")))); |
(...skipping 822 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1002 // left without permission to use Push. | 1004 // left without permission to use Push. |
1003 | 1005 |
1004 ASSERT_TRUE(RunScript("hasPermission()", &script_result)); | 1006 ASSERT_TRUE(RunScript("hasPermission()", &script_result)); |
1005 EXPECT_EQ("permission status - granted", script_result); | 1007 EXPECT_EQ("permission status - granted", script_result); |
1006 | 1008 |
1007 ASSERT_TRUE(RunScript("hasRegistration()", &script_result)); | 1009 ASSERT_TRUE(RunScript("hasRegistration()", &script_result)); |
1008 EXPECT_EQ("true - registered", script_result); | 1010 EXPECT_EQ("true - registered", script_result); |
1009 } | 1011 } |
1010 | 1012 |
1011 } // namespace gcm | 1013 } // namespace gcm |
OLD | NEW |