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

Side by Side Diff: chrome/browser/extensions/activity_log/activity_log_unittest.cc

Issue 2321083002: [NoStatePrefetch] Add performance histograms. (Closed)
Patch Set: Review comments 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chrome/browser/extensions/activity_log/activity_log.h" 5 #include "chrome/browser/extensions/activity_log/activity_log.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <memory> 9 #include <memory>
10 10
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 .Set("manifest_version", 2) 248 .Set("manifest_version", 2)
249 .Build()) 249 .Build())
250 .Build(); 250 .Build();
251 extension_service_->AddExtension(extension.get()); 251 extension_service_->AddExtension(extension.get());
252 ActivityLog* activity_log = ActivityLog::GetInstance(profile()); 252 ActivityLog* activity_log = ActivityLog::GetInstance(profile());
253 EXPECT_TRUE(activity_log->ShouldLog(extension->id())); 253 EXPECT_TRUE(activity_log->ShouldLog(extension->id()));
254 ASSERT_TRUE(GetDatabaseEnabled()); 254 ASSERT_TRUE(GetDatabaseEnabled());
255 GURL url("http://www.google.com"); 255 GURL url("http://www.google.com");
256 256
257 prerender::PrerenderManager* prerender_manager = 257 prerender::PrerenderManager* prerender_manager =
258 prerender::PrerenderManagerFactory::GetForProfile( 258 prerender::PrerenderManagerFactory::GetForBrowserContext(profile());
259 Profile::FromBrowserContext(profile()));
260 259
261 const gfx::Size kSize(640, 480); 260 const gfx::Size kSize(640, 480);
262 std::unique_ptr<prerender::PrerenderHandle> prerender_handle( 261 std::unique_ptr<prerender::PrerenderHandle> prerender_handle(
263 prerender_manager->AddPrerenderFromOmnibox( 262 prerender_manager->AddPrerenderFromOmnibox(
264 url, 263 url,
265 web_contents()->GetController().GetDefaultSessionStorageNamespace(), 264 web_contents()->GetController().GetDefaultSessionStorageNamespace(),
266 kSize)); 265 kSize));
267 266
268 const std::vector<content::WebContents*> contentses = 267 const std::vector<content::WebContents*> contentses =
269 prerender_manager->GetAllPrerenderingContents(); 268 prerender_manager->GetAllPrerenderingContents();
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
446 EXPECT_TRUE(activity_log->ShouldLog(empty_extension->id())); 445 EXPECT_TRUE(activity_log->ShouldLog(empty_extension->id()));
447 // ... but not those of the watchdog app. 446 // ... but not those of the watchdog app.
448 EXPECT_FALSE(activity_log->ShouldLog(activity_log_extension->id())); 447 EXPECT_FALSE(activity_log->ShouldLog(activity_log_extension->id()));
449 extension_service_->DisableExtension(activity_log_extension->id(), 448 extension_service_->DisableExtension(activity_log_extension->id(),
450 Extension::DISABLE_USER_ACTION); 449 Extension::DISABLE_USER_ACTION);
451 // Disabling the watchdog app means that we're back to never logging anything. 450 // Disabling the watchdog app means that we're back to never logging anything.
452 EXPECT_FALSE(activity_log->ShouldLog(empty_extension->id())); 451 EXPECT_FALSE(activity_log->ShouldLog(empty_extension->id()));
453 } 452 }
454 453
455 } // namespace extensions 454 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/activity_log/activity_log_browsertest.cc ('k') | chrome/browser/history/history_tab_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698