OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
9 #include "base/scoped_observer.h" | 9 #include "base/scoped_observer.h" |
10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 public: | 62 public: |
63 WakeEventPageTest() {} | 63 WakeEventPageTest() {} |
64 | 64 |
65 protected: | 65 protected: |
66 enum BackgroundPageConfiguration { EVENT, PERSISTENT, NONE }; | 66 enum BackgroundPageConfiguration { EVENT, PERSISTENT, NONE }; |
67 | 67 |
68 void RunTest(bool expect_success, | 68 void RunTest(bool expect_success, |
69 BackgroundPageConfiguration bg_config, | 69 BackgroundPageConfiguration bg_config, |
70 bool should_close, | 70 bool should_close, |
71 bool will_be_open) { | 71 bool will_be_open) { |
72 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); | 72 ASSERT_TRUE(embedded_test_server()->Start()); |
73 | 73 |
74 GURL web_url = embedded_test_server()->GetURL("example.com", "/empty.html"); | 74 GURL web_url = embedded_test_server()->GetURL("example.com", "/empty.html"); |
75 host_resolver()->AddRule(web_url.host(), "127.0.0.1"); | 75 host_resolver()->AddRule(web_url.host(), "127.0.0.1"); |
76 | 76 |
77 TestExtensionDir extension_dir; | 77 TestExtensionDir extension_dir; |
78 { | 78 { |
79 std::string manifest_json; | 79 std::string manifest_json; |
80 switch (bg_config) { | 80 switch (bg_config) { |
81 case EVENT: | 81 case EVENT: |
82 manifest_json = | 82 manifest_json = |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 true /* will_be_open */); | 176 true /* will_be_open */); |
177 } | 177 } |
178 | 178 |
179 IN_PROC_BROWSER_TEST_F(WakeEventPageTest, NoBackgroundPage) { | 179 IN_PROC_BROWSER_TEST_F(WakeEventPageTest, NoBackgroundPage) { |
180 RunTest(false /* expect_success */, NONE, false /* should_close */, | 180 RunTest(false /* expect_success */, NONE, false /* should_close */, |
181 false /* will_be_open */); | 181 false /* will_be_open */); |
182 } | 182 } |
183 | 183 |
184 } // namespace | 184 } // namespace |
185 } // namespace extensions | 185 } // namespace extensions |
OLD | NEW |