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

Side by Side Diff: chrome/browser/extensions/api/debugger/debugger_apitest.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) 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 <stddef.h> 5 #include <stddef.h>
6 6
7 #include <string> 7 #include <string>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 int tab_id = SessionTabHelper::IdForTab(web_contents); 89 int tab_id = SessionTabHelper::IdForTab(web_contents);
90 std::string debugee_by_tab = base::StringPrintf("{\"tabId\": %d}", tab_id); 90 std::string debugee_by_tab = base::StringPrintf("{\"tabId\": %d}", tab_id);
91 testing::AssertionResult result = 91 testing::AssertionResult result =
92 RunAttachFunctionOnTarget(debugee_by_tab, expected_error); 92 RunAttachFunctionOnTarget(debugee_by_tab, expected_error);
93 if (!result) 93 if (!result)
94 return result; 94 return result;
95 95
96 // Attach by targetId. 96 // Attach by targetId.
97 scoped_refptr<DebuggerGetTargetsFunction> get_targets_function = 97 scoped_refptr<DebuggerGetTargetsFunction> get_targets_function =
98 new DebuggerGetTargetsFunction(); 98 new DebuggerGetTargetsFunction();
99 scoped_ptr<base::Value> value( 99 std::unique_ptr<base::Value> value(
100 extension_function_test_utils::RunFunctionAndReturnSingleResult( 100 extension_function_test_utils::RunFunctionAndReturnSingleResult(
101 get_targets_function.get(), "[]", browser())); 101 get_targets_function.get(), "[]", browser()));
102 base::ListValue* targets = nullptr; 102 base::ListValue* targets = nullptr;
103 EXPECT_TRUE(value->GetAsList(&targets)); 103 EXPECT_TRUE(value->GetAsList(&targets));
104 104
105 std::string debugger_target_id; 105 std::string debugger_target_id;
106 for (size_t i = 0; i < targets->GetSize(); ++i) { 106 for (size_t i = 0; i < targets->GetSize(); ++i) {
107 base::DictionaryValue* target_dict = nullptr; 107 base::DictionaryValue* target_dict = nullptr;
108 EXPECT_TRUE(targets->GetDictionary(i, &target_dict)); 108 EXPECT_TRUE(targets->GetDictionary(i, &target_dict));
109 int id = -1; 109 int id = -1;
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
299 // Detach should remove the remaining infobar. 299 // Detach should remove the remaining infobar.
300 detach_function = new DebuggerDetachFunction(); 300 detach_function = new DebuggerDetachFunction();
301 detach_function->set_extension(extension()); 301 detach_function->set_extension(extension());
302 ASSERT_TRUE(RunFunction(detach_function.get(), 302 ASSERT_TRUE(RunFunction(detach_function.get(),
303 base::StringPrintf("[{\"tabId\": %d}]", tab_id), 303 base::StringPrintf("[{\"tabId\": %d}]", tab_id),
304 browser(), extension_function_test_utils::NONE)); 304 browser(), extension_function_test_utils::NONE));
305 EXPECT_EQ(0u, service1->infobar_count()); 305 EXPECT_EQ(0u, service1->infobar_count());
306 } 306 }
307 307
308 } // namespace extensions 308 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698