| 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 <string> | 5 #include <string> |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "chrome/browser/infobars/infobar_service.h" | 10 #include "chrome/browser/infobars/infobar_service.h" |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 browser()->tab_strip_model()->GetActiveWebContents()->GetMainFrame(), | 115 browser()->tab_strip_model()->GetActiveWebContents()->GetMainFrame(), |
| 116 script, | 116 script, |
| 117 result); | 117 result); |
| 118 } | 118 } |
| 119 | 119 |
| 120 bool RegisterServiceWorker(std::string* result) { | 120 bool RegisterServiceWorker(std::string* result) { |
| 121 return RunScript("registerServiceWorker()", result); | 121 return RunScript("registerServiceWorker()", result); |
| 122 } | 122 } |
| 123 | 123 |
| 124 bool RegisterPush(std::string* result) { | 124 bool RegisterPush(std::string* result) { |
| 125 return RunScript("registerPush('1234567890')", result); | 125 return RunScript("registerPush()", result); |
| 126 } | 126 } |
| 127 | 127 |
| 128 net::SpawnedTestServer* https_server() const { return https_server_.get(); } | 128 net::SpawnedTestServer* https_server() const { return https_server_.get(); } |
| 129 | 129 |
| 130 FakeGCMProfileService* gcm_service() const { return gcm_service_; } | 130 FakeGCMProfileService* gcm_service() const { return gcm_service_; } |
| 131 | 131 |
| 132 private: | 132 private: |
| 133 scoped_ptr<net::SpawnedTestServer> https_server_; | 133 scoped_ptr<net::SpawnedTestServer> https_server_; |
| 134 FakeGCMProfileService* gcm_service_; | 134 FakeGCMProfileService* gcm_service_; |
| 135 | 135 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 159 | 159 |
| 160 InfoBarResponder cancelling_responder(browser(), false); | 160 InfoBarResponder cancelling_responder(browser(), false); |
| 161 | 161 |
| 162 std::string register_push_result; | 162 std::string register_push_result; |
| 163 ASSERT_TRUE(RegisterPush(®ister_push_result)); | 163 ASSERT_TRUE(RegisterPush(®ister_push_result)); |
| 164 EXPECT_EQ("AbortError - Registration failed - permission denied", | 164 EXPECT_EQ("AbortError - Registration failed - permission denied", |
| 165 register_push_result); | 165 register_push_result); |
| 166 } | 166 } |
| 167 | 167 |
| 168 } // namespace gcm | 168 } // namespace gcm |
| OLD | NEW |