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

Side by Side Diff: chrome/browser/extensions/wake_event_page_apitest.cc

Issue 1409163006: Migrating tests to use EmbeddedTestServer (/chrome/browser misc) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 5 years, 1 month 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 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
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
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
OLDNEW
« no previous file with comments | « chrome/browser/extensions/subscribe_page_action_browsertest.cc ('k') | chrome/browser/extensions/webstore_installer_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698