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

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

Issue 233353003: Only commit cookie changes in prerenders after a prerender is shown (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Add browser tests, fix a bug in what was changed yesterday. Created 6 years, 7 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 | Annotate | Revision Log
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 "base/command_line.h" 5 #include "base/command_line.h"
6 #include "base/memory/scoped_ptr.h" 6 #include "base/memory/scoped_ptr.h"
7 #include "base/message_loop/message_loop.h" 7 #include "base/message_loop/message_loop.h"
8 #include "base/run_loop.h" 8 #include "base/run_loop.h"
9 #include "base/synchronization/waitable_event.h" 9 #include "base/synchronization/waitable_event.h"
10 #include "chrome/browser/extensions/activity_log/activity_action_constants.h" 10 #include "chrome/browser/extensions/activity_log/activity_action_constants.h"
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 .Build(); 237 .Build();
238 extension_service_->AddExtension(extension.get()); 238 extension_service_->AddExtension(extension.get());
239 ActivityLog* activity_log = ActivityLog::GetInstance(profile()); 239 ActivityLog* activity_log = ActivityLog::GetInstance(profile());
240 ASSERT_TRUE(GetDatabaseEnabled()); 240 ASSERT_TRUE(GetDatabaseEnabled());
241 GURL url("http://www.google.com"); 241 GURL url("http://www.google.com");
242 242
243 prerender::PrerenderManager* prerender_manager = 243 prerender::PrerenderManager* prerender_manager =
244 prerender::PrerenderManagerFactory::GetForProfile( 244 prerender::PrerenderManagerFactory::GetForProfile(
245 Profile::FromBrowserContext(profile())); 245 Profile::FromBrowserContext(profile()));
246 246
247 prerender_manager->OnCookieStoreLoaded();
248
247 const gfx::Size kSize(640, 480); 249 const gfx::Size kSize(640, 480);
248 scoped_ptr<prerender::PrerenderHandle> prerender_handle( 250 scoped_ptr<prerender::PrerenderHandle> prerender_handle(
249 prerender_manager->AddPrerenderFromLocalPredictor( 251 prerender_manager->AddPrerenderFromLocalPredictor(
250 url, 252 url,
251 web_contents()->GetController().GetDefaultSessionStorageNamespace(), 253 web_contents()->GetController().GetDefaultSessionStorageNamespace(),
252 kSize)); 254 kSize));
253 255
254 const std::vector<content::WebContents*> contentses = 256 const std::vector<content::WebContents*> contentses =
255 prerender_manager->GetAllPrerenderingContents(); 257 prerender_manager->GetAllPrerenderingContents();
256 ASSERT_EQ(1U, contentses.size()); 258 ASSERT_EQ(1U, contentses.size());
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
399 kExtensionId, 401 kExtensionId,
400 Action::ACTION_ANY, 402 Action::ACTION_ANY,
401 "", 403 "",
402 "", 404 "",
403 "", 405 "",
404 -1, 406 -1,
405 base::Bind(ActivityLogTest::RetrieveActions_ArgUrlApiCalls)); 407 base::Bind(ActivityLogTest::RetrieveActions_ArgUrlApiCalls));
406 } 408 }
407 409
408 } // namespace extensions 410 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698