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

Side by Side Diff: testing/android/native_test/native_test_util.cc

Issue 1138993009: Revert of [Android] Refactor the native test wrappers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
« no previous file with comments | « testing/android/native_test/native_test_util.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "testing/android/native_test/native_test_util.h" 5 #include "testing/android/native_test/native_test_util.h"
6 6
7 #include "base/files/file_path.h" 7 #include "base/files/file_path.h"
8 #include "base/files/file_util.h" 8 #include "base/files/file_util.h"
9 #include "base/strings/string_tokenizer.h" 9 #include "base/strings/string_tokenizer.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
11 11
12 namespace testing { 12 namespace testing {
13 namespace android { 13 namespace native_test_util {
14 14
15 void ParseArgsFromString(const std::string& command_line, 15 void ParseArgsFromString(const std::string& command_line,
16 std::vector<std::string>* args) { 16 std::vector<std::string>* args) {
17 base::StringTokenizer tokenizer(command_line, base::kWhitespaceASCII); 17 base::StringTokenizer tokenizer(command_line, base::kWhitespaceASCII);
18 tokenizer.set_quote_chars("\""); 18 tokenizer.set_quote_chars("\"");
19 while (tokenizer.GetNext()) { 19 while (tokenizer.GetNext()) {
20 std::string token; 20 std::string token;
21 base::RemoveChars(tokenizer.token(), "\"", &token); 21 base::RemoveChars(tokenizer.token(), "\"", &token);
22 args->push_back(token); 22 args->push_back(token);
23 } 23 }
(...skipping 15 matching lines...) Expand all
39 39
40 argv->resize(argc + 1); 40 argv->resize(argc + 1);
41 for (int i = 0; i < argc; ++i) { 41 for (int i = 0; i < argc; ++i) {
42 (*argv)[i] = const_cast<char*>(args[i].c_str()); 42 (*argv)[i] = const_cast<char*>(args[i].c_str());
43 } 43 }
44 (*argv)[argc] = NULL; // argv must be NULL terminated. 44 (*argv)[argc] = NULL; // argv must be NULL terminated.
45 45
46 return argc; 46 return argc;
47 } 47 }
48 48
49 } // namespace android 49 } // namespace native_test_util
50 } // namespace testing 50 } // namespace testing
OLDNEW
« no previous file with comments | « testing/android/native_test/native_test_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698