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

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

Issue 1871713002: Convert //chrome/browser/extensions from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase and fix header Created 4 years, 8 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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 <stdint.h> 5 #include <stdint.h>
6 6
7 #include "base/location.h" 7 #include "base/location.h"
8 #include "base/single_thread_task_runner.h" 8 #include "base/single_thread_task_runner.h"
9 #include "base/strings/stringprintf.h" 9 #include "base/strings/stringprintf.h"
10 #include "base/thread_task_runner_handle.h" 10 #include "base/thread_task_runner_handle.h"
(...skipping 23 matching lines...) Expand all
34 void SetUpCommandLine(base::CommandLine* command_line) override { 34 void SetUpCommandLine(base::CommandLine* command_line) override {
35 ExtensionBrowserTest::SetUpCommandLine(command_line); 35 ExtensionBrowserTest::SetUpCommandLine(command_line);
36 command_line->AppendSwitch(switches::kEnableExtensionActivityLogging); 36 command_line->AppendSwitch(switches::kEnableExtensionActivityLogging);
37 command_line->AppendSwitchASCII(switches::kPrerenderMode, 37 command_line->AppendSwitchASCII(switches::kPrerenderMode,
38 switches::kPrerenderModeSwitchValueEnabled); 38 switches::kPrerenderModeSwitchValueEnabled);
39 } 39 }
40 40
41 static void Prerender_Arguments( 41 static void Prerender_Arguments(
42 const std::string& extension_id, 42 const std::string& extension_id,
43 uint16_t port, 43 uint16_t port,
44 scoped_ptr<std::vector<scoped_refptr<Action>>> i) { 44 std::unique_ptr<std::vector<scoped_refptr<Action>>> i) {
45 // This is to exit RunLoop (base::MessageLoop::current()->Run()) below 45 // This is to exit RunLoop (base::MessageLoop::current()->Run()) below
46 base::ThreadTaskRunnerHandle::Get()->PostTask( 46 base::ThreadTaskRunnerHandle::Get()->PostTask(
47 FROM_HERE, base::MessageLoop::QuitWhenIdleClosure()); 47 FROM_HERE, base::MessageLoop::QuitWhenIdleClosure());
48 48
49 ASSERT_TRUE(i->size()); 49 ASSERT_TRUE(i->size());
50 scoped_refptr<Action> last = i->front(); 50 scoped_refptr<Action> last = i->front();
51 51
52 ASSERT_EQ(extension_id, last->extension_id()); 52 ASSERT_EQ(extension_id, last->extension_id());
53 ASSERT_EQ(Action::ACTION_CONTENT_SCRIPT, last->action_type()); 53 ASSERT_EQ(Action::ACTION_CONTENT_SCRIPT, last->action_type());
54 ASSERT_EQ("[\"/google_cs.js\"]", 54 ASSERT_EQ("[\"/google_cs.js\"]",
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 98
99 content::WindowedNotificationObserver page_observer( 99 content::WindowedNotificationObserver page_observer(
100 content::NOTIFICATION_LOAD_STOP, 100 content::NOTIFICATION_LOAD_STOP,
101 content::NotificationService::AllSources()); 101 content::NotificationService::AllSources());
102 102
103 GURL url(base::StringPrintf( 103 GURL url(base::StringPrintf(
104 "http://www.google.com.bo:%u/test.html", 104 "http://www.google.com.bo:%u/test.html",
105 port)); 105 port));
106 106
107 const gfx::Size kSize(640, 480); 107 const gfx::Size kSize(640, 480);
108 scoped_ptr<prerender::PrerenderHandle> prerender_handle( 108 std::unique_ptr<prerender::PrerenderHandle> prerender_handle(
109 prerender_manager->AddPrerenderFromOmnibox( 109 prerender_manager->AddPrerenderFromOmnibox(
110 url, 110 url,
111 web_contents->GetController().GetDefaultSessionStorageNamespace(), 111 web_contents->GetController().GetDefaultSessionStorageNamespace(),
112 kSize)); 112 kSize));
113 113
114 page_observer.Wait(); 114 page_observer.Wait();
115 115
116 activity_log->GetFilteredActions( 116 activity_log->GetFilteredActions(
117 ext->id(), 117 ext->id(),
118 Action::ACTION_ANY, 118 Action::ACTION_ANY,
119 "", 119 "",
120 "", 120 "",
121 "", 121 "",
122 -1, 122 -1,
123 base::Bind( 123 base::Bind(
124 ActivityLogPrerenderTest::Prerender_Arguments, ext->id(), port)); 124 ActivityLogPrerenderTest::Prerender_Arguments, ext->id(), port));
125 125
126 // Allow invocation of Prerender_Arguments 126 // Allow invocation of Prerender_Arguments
127 base::MessageLoop::current()->Run(); 127 base::MessageLoop::current()->Run();
128 } 128 }
129 129
130 } // namespace extensions 130 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698