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

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

Issue 1549233002: Convert Pass()→std::move() in //chrome/browser/extensions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 12 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "extensions/browser/process_manager.h" 5 #include "extensions/browser/process_manager.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <utility>
8 9
9 #include "base/callback.h" 10 #include "base/callback.h"
10 #include "base/macros.h" 11 #include "base/macros.h"
11 #include "base/memory/scoped_ptr.h" 12 #include "base/memory/scoped_ptr.h"
12 #include "base/run_loop.h" 13 #include "base/run_loop.h"
13 #include "chrome/browser/extensions/browser_action_test_util.h" 14 #include "chrome/browser/extensions/browser_action_test_util.h"
14 #include "chrome/browser/extensions/extension_browsertest.h" 15 #include "chrome/browser/extensions/extension_browsertest.h"
15 #include "chrome/browser/extensions/extension_service.h" 16 #include "chrome/browser/extensions/extension_service.h"
16 #include "chrome/browser/extensions/test_extension_dir.h" 17 #include "chrome/browser/extensions/test_extension_dir.h"
17 #include "chrome/browser/ui/tabs/tab_strip_model.h" 18 #include "chrome/browser/ui/tabs/tab_strip_model.h"
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 "<iframe id='frame2' src='empty.html'></iframe>"); 127 "<iframe id='frame2' src='empty.html'></iframe>");
127 128
128 dir->WriteFile(FILE_PATH_LITERAL("sandboxed.html"), "Some sandboxed page"); 129 dir->WriteFile(FILE_PATH_LITERAL("sandboxed.html"), "Some sandboxed page");
129 130
130 dir->WriteFile(FILE_PATH_LITERAL("empty.html"), ""); 131 dir->WriteFile(FILE_PATH_LITERAL("empty.html"), "");
131 132
132 dir->WriteManifest(manifest.ToJSON()); 133 dir->WriteManifest(manifest.ToJSON());
133 134
134 const Extension* extension = LoadExtension(dir->unpacked_path()); 135 const Extension* extension = LoadExtension(dir->unpacked_path());
135 EXPECT_TRUE(extension); 136 EXPECT_TRUE(extension);
136 temp_dirs_.push_back(dir.Pass()); 137 temp_dirs_.push_back(std::move(dir));
137 return extension; 138 return extension;
138 } 139 }
139 140
140 // ui_test_utils::NavigateToURL sometimes returns too early: It returns as 141 // ui_test_utils::NavigateToURL sometimes returns too early: It returns as
141 // soon as the StopLoading notification has been triggered. This does not 142 // soon as the StopLoading notification has been triggered. This does not
142 // imply that RenderFrameDeleted was called, so the test may continue too 143 // imply that RenderFrameDeleted was called, so the test may continue too
143 // early and fail when ProcessManager::GetAllFrames() returns too many frames 144 // early and fail when ProcessManager::GetAllFrames() returns too many frames
144 // (namely frames that are in the process of being deleted). To work around 145 // (namely frames that are in the process of being deleted). To work around
145 // this problem, we also wait until all previous frames have been deleted. 146 // this problem, we also wait until all previous frames have been deleted.
146 void NavigateToURL(const GURL& url) { 147 void NavigateToURL(const GURL& url) {
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after
519 pm->OnNetworkRequestDone(frame_host, 1); 520 pm->OnNetworkRequestDone(frame_host, 1);
520 EXPECT_EQ(baseline_keepalive, pm->GetLazyKeepaliveCount(extension.get())); 521 EXPECT_EQ(baseline_keepalive, pm->GetLazyKeepaliveCount(extension.get()));
521 522
522 // Simulate only a request completion for this ID and ensure it doesn't result 523 // Simulate only a request completion for this ID and ensure it doesn't result
523 // in keepalive decrement. 524 // in keepalive decrement.
524 pm->OnNetworkRequestDone(frame_host, 2); 525 pm->OnNetworkRequestDone(frame_host, 2);
525 EXPECT_EQ(baseline_keepalive, pm->GetLazyKeepaliveCount(extension.get())); 526 EXPECT_EQ(baseline_keepalive, pm->GetLazyKeepaliveCount(extension.get()));
526 } 527 }
527 528
528 } // namespace extensions 529 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/policy_handlers.cc ('k') | chrome/browser/extensions/shared_module_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698