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: base/test/launcher/unit_test_launcher.cc

Issue 2275553005: //base: Make ScopedTempDir::path() a GetPath() with a DCHECK (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
« no previous file with comments | « base/test/launcher/test_launcher_ios.cc ('k') | base/test/scoped_path_override.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 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 "base/test/launcher/unit_test_launcher.h" 5 #include "base/test/launcher/unit_test_launcher.h"
6 6
7 #include "base/base_switches.h" 7 #include "base/base_switches.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/callback_helpers.h" 9 #include "base/callback_helpers.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 return true; 114 return true;
115 } 115 }
116 116
117 CommandLine GetCommandLineForChildGTestProcess( 117 CommandLine GetCommandLineForChildGTestProcess(
118 const std::vector<std::string>& test_names, 118 const std::vector<std::string>& test_names,
119 const base::FilePath& output_file) override { 119 const base::FilePath& output_file) override {
120 CommandLine new_cmd_line(*CommandLine::ForCurrentProcess()); 120 CommandLine new_cmd_line(*CommandLine::ForCurrentProcess());
121 121
122 CHECK(temp_dir_.IsValid() || temp_dir_.CreateUniqueTempDir()); 122 CHECK(temp_dir_.IsValid() || temp_dir_.CreateUniqueTempDir());
123 FilePath temp_file; 123 FilePath temp_file;
124 CHECK(CreateTemporaryFileInDir(temp_dir_.path(), &temp_file)); 124 CHECK(CreateTemporaryFileInDir(temp_dir_.GetPath(), &temp_file));
125 std::string long_flags( 125 std::string long_flags(
126 std::string("--") + kGTestFilterFlag + "=" + 126 std::string("--") + kGTestFilterFlag + "=" +
127 JoinString(test_names, ":")); 127 JoinString(test_names, ":"));
128 CHECK_EQ(static_cast<int>(long_flags.size()), 128 CHECK_EQ(static_cast<int>(long_flags.size()),
129 WriteFile(temp_file, 129 WriteFile(temp_file,
130 long_flags.data(), 130 long_flags.data(),
131 static_cast<int>(long_flags.size()))); 131 static_cast<int>(long_flags.size())));
132 132
133 new_cmd_line.AppendSwitchPath(switches::kTestLauncherOutput, output_file); 133 new_cmd_line.AppendSwitchPath(switches::kTestLauncherOutput, output_file);
134 new_cmd_line.AppendSwitchPath(kGTestFlagfileFlag, temp_file); 134 new_cmd_line.AppendSwitchPath(kGTestFlagfileFlag, temp_file);
(...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after
627 TestLauncher* test_launcher, 627 TestLauncher* test_launcher,
628 const std::vector<std::string>& test_names) { 628 const std::vector<std::string>& test_names) {
629 ThreadTaskRunnerHandle::Get()->PostTask( 629 ThreadTaskRunnerHandle::Get()->PostTask(
630 FROM_HERE, 630 FROM_HERE,
631 Bind(&RunUnitTestsSerially, test_launcher, platform_delegate_, test_names, 631 Bind(&RunUnitTestsSerially, test_launcher, platform_delegate_, test_names,
632 use_job_objects_ ? TestLauncher::USE_JOB_OBJECTS : 0)); 632 use_job_objects_ ? TestLauncher::USE_JOB_OBJECTS : 0));
633 return test_names.size(); 633 return test_names.size();
634 } 634 }
635 635
636 } // namespace base 636 } // namespace base
OLDNEW
« no previous file with comments | « base/test/launcher/test_launcher_ios.cc ('k') | base/test/scoped_path_override.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698