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

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

Issue 2314363002: extensions: Change ScopedTempDir::path() to GetPath() (Closed)
Patch Set: Comment addressed Created 4 years, 3 months 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/macros.h" 8 #include "base/macros.h"
9 #include "base/run_loop.h" 9 #include "base/run_loop.h"
10 #include "base/scoped_observer.h" 10 #include "base/scoped_observer.h"
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 } 101 }
102 base::ReplaceChars(manifest_json, "'", "\"", &manifest_json); 102 base::ReplaceChars(manifest_json, "'", "\"", &manifest_json);
103 extension_dir.WriteManifest(manifest_json); 103 extension_dir.WriteManifest(manifest_json);
104 // Empty background page. Closing/opening it is driven by this test. 104 // Empty background page. Closing/opening it is driven by this test.
105 extension_dir.WriteFile(FILE_PATH_LITERAL("background.js"), ""); 105 extension_dir.WriteFile(FILE_PATH_LITERAL("background.js"), "");
106 extension_dir.WriteFile(FILE_PATH_LITERAL("content_script.js"), 106 extension_dir.WriteFile(FILE_PATH_LITERAL("content_script.js"),
107 kContentScriptJs); 107 kContentScriptJs);
108 } 108 }
109 109
110 // Install the extension, then close its background page if desired.. 110 // Install the extension, then close its background page if desired..
111 const Extension* extension = LoadExtension(extension_dir.unpacked_path()); 111 const Extension* extension = LoadExtension(extension_dir.UnpackedPath());
112 CHECK(extension); 112 CHECK(extension);
113 113
114 // Regardless of |will_be_open|, we haven't closed the background page yet, 114 // Regardless of |will_be_open|, we haven't closed the background page yet,
115 // so it should always open if it exists. 115 // so it should always open if it exists.
116 if (bg_config != NONE) 116 if (bg_config != NONE)
117 BackgroundPageWatcher(process_manager(), extension).WaitForOpen(); 117 BackgroundPageWatcher(process_manager(), extension).WaitForOpen();
118 118
119 if (should_close) { 119 if (should_close) {
120 GetBackgroundPage(extension->id())->Close(); 120 GetBackgroundPage(extension->id())->Close();
121 BackgroundPageWatcher(process_manager(), extension).WaitForClose(); 121 BackgroundPageWatcher(process_manager(), extension).WaitForClose();
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 true /* will_be_open */); 177 true /* will_be_open */);
178 } 178 }
179 179
180 IN_PROC_BROWSER_TEST_F(WakeEventPageTest, NoBackgroundPage) { 180 IN_PROC_BROWSER_TEST_F(WakeEventPageTest, NoBackgroundPage) {
181 RunTest(false /* expect_success */, NONE, false /* should_close */, 181 RunTest(false /* expect_success */, NONE, false /* should_close */,
182 false /* will_be_open */); 182 false /* will_be_open */);
183 } 183 }
184 184
185 } // namespace 185 } // namespace
186 } // namespace extensions 186 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698