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

Issue 1484713003: [Chromecast] Use ScopedTemp[File|Dir] in tests. (Closed)

Created:
5 years ago by slan
Modified:
5 years ago
Reviewers:
lcwu1, halliwell, M-A Ruel, bcf
CC:
chromium-reviews, gunsch+watch_chromium.org, lcwu+watch_chromium.org, sadrul, halliwell+watch_chromium.org, kalyank
Base URL:
https://chromium.googlesource.com/chromium/src@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[Chromecast] Use ScopedTemp[File|Dir] in tests. Files and directories created in a test should be removed as soon as the test is done executing. Replace all uses of base::CreateNewTempDirectory() with base::ScopedTempDir. Also introduce a ScopedTempFile to ensure automatic clean-up of files created for testing. BUG=561597 Bug: b/22953577 Committed: https://crrev.com/ef83eab02623a35a59fe181addb2fae1b0436efc Cr-Commit-Position: refs/heads/master@{#363875}

Patch Set 1 #

Patch Set 2 : Move ScopedTempFile impl into .cc #

Patch Set 3 : Style #

Total comments: 2

Patch Set 4 : Fix bug in test fixture, add CHECK to ScopedTempFile::Read #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+200 lines, -128 lines) Patch
M chromecast/app/BUILD.gn View 1 1 chunk +1 line, -0 lines 0 comments Download
M chromecast/app/linux/cast_crash_reporter_client_unittest.cc View 1 2 3 6 chunks +16 lines, -15 lines 0 comments Download
M chromecast/base/BUILD.gn View 1 3 chunks +16 lines, -2 lines 0 comments Download
M chromecast/base/error_codes_unittest.cc View 1 2 3 chunks +12 lines, -8 lines 0 comments Download
A chromecast/base/scoped_temp_file.h View 1 1 chunk +47 lines, -0 lines 0 comments Download
A chromecast/base/scoped_temp_file.cc View 1 2 3 1 chunk +38 lines, -0 lines 2 comments Download
M chromecast/base/serializers_unittest.cc View 1 2 6 chunks +17 lines, -50 lines 0 comments Download
M chromecast/chromecast.gyp View 1 1 chunk +2 lines, -0 lines 0 comments Download
M chromecast/crash/BUILD.gn View 1 1 chunk +1 line, -0 lines 0 comments Download
M chromecast/crash/cast_crashdump_uploader_unittest.cc View 9 chunks +16 lines, -20 lines 0 comments Download
M chromecast/crash/linux/dummy_minidump_generator_unittest.cc View 3 chunks +20 lines, -19 lines 0 comments Download
M chromecast/crash/linux/minidump_writer_unittest.cc View 3 chunks +7 lines, -4 lines 0 comments Download
M chromecast/crash/linux/synchronized_minidump_manager_unittest.cc View 3 chunks +7 lines, -10 lines 0 comments Download

Messages

Total messages: 43 (14 generated)
slan
This change ensures that files and directories created for testing are deleted when the scope ...
5 years ago (2015-11-30 16:41:23 UTC) #2
slan
+maruel@ for visibility on crbug.com/561597
5 years ago (2015-11-30 16:43:24 UTC) #4
slan
+lcwu@ for OWNERS while halliwell@ is OOO
5 years ago (2015-11-30 17:39:32 UTC) #6
M-A Ruel
On 2015/11/30 17:39:32, slan wrote: > +lcwu@ for OWNERS while halliwell@ is OOO Thanks for ...
5 years ago (2015-11-30 18:27:32 UTC) #7
slan
On 2015/11/30 18:27:32, M-A Ruel wrote: > On 2015/11/30 17:39:32, slan wrote: > > +lcwu@ ...
5 years ago (2015-11-30 18:34:07 UTC) #8
M-A Ruel
On 2015/11/30 18:34:07, slan wrote: > On 2015/11/30 18:27:32, M-A Ruel wrote: > > On ...
5 years ago (2015-11-30 21:37:44 UTC) #9
slan
On 2015/11/30 21:37:44, M-A Ruel wrote: > On 2015/11/30 18:34:07, slan wrote: > > On ...
5 years ago (2015-11-30 21:44:18 UTC) #10
M-A Ruel
On 2015/11/30 21:44:18, slan wrote: > On 2015/11/30 21:37:44, M-A Ruel wrote: > > On ...
5 years ago (2015-11-30 21:56:55 UTC) #13
slan
> I don't think creating the file in ScopedTempFile constructor is a good idea. I ...
5 years ago (2015-11-30 22:10:48 UTC) #14
slan
On 2015/11/30 22:10:48, slan wrote: > > I don't think creating the file in ScopedTempFile ...
5 years ago (2015-12-04 23:09:52 UTC) #15
M-A Ruel
On 2015/12/04 23:09:52, slan wrote: > Ping! In particular Brett and Le-Chun. I'm not an ...
5 years ago (2015-12-04 23:31:43 UTC) #16
slan
On 2015/12/04 23:31:43, M-A Ruel wrote: > On 2015/12/04 23:09:52, slan wrote: > > Ping! ...
5 years ago (2015-12-05 02:22:05 UTC) #17
slan
On 2015/12/05 02:22:05, slan wrote: > On 2015/12/04 23:31:43, M-A Ruel wrote: > > On ...
5 years ago (2015-12-05 02:25:09 UTC) #19
halliwell
On 2015/12/05 02:25:09, slan wrote: > On 2015/12/05 02:22:05, slan wrote: > > On 2015/12/04 ...
5 years ago (2015-12-07 18:44:16 UTC) #20
slan
> This lgtm, but I don't see a resolution on this question: > > " ...
5 years ago (2015-12-08 16:45:51 UTC) #21
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1484713003/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1484713003/40001
5 years ago (2015-12-08 16:46:17 UTC) #23
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: cast_shell_linux on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/cast_shell_linux/builds/89926)
5 years ago (2015-12-08 17:12:17 UTC) #25
bcf
On 2015/12/08 16:45:51, slan wrote: > > This lgtm, but I don't see a resolution ...
5 years ago (2015-12-08 18:56:44 UTC) #26
bcf
https://codereview.chromium.org/1484713003/diff/40001/chromecast/base/scoped_temp_file.cc File chromecast/base/scoped_temp_file.cc (right): https://codereview.chromium.org/1484713003/diff/40001/chromecast/base/scoped_temp_file.cc#newcode34 chromecast/base/scoped_temp_file.cc:34: ReadFileToString(path_, &result); How about a CHECK for this?
5 years ago (2015-12-08 18:56:55 UTC) #27
slan
https://codereview.chromium.org/1484713003/diff/40001/chromecast/base/scoped_temp_file.cc File chromecast/base/scoped_temp_file.cc (right): https://codereview.chromium.org/1484713003/diff/40001/chromecast/base/scoped_temp_file.cc#newcode34 chromecast/base/scoped_temp_file.cc:34: ReadFileToString(path_, &result); On 2015/12/08 18:56:55, bcf wrote: > How ...
5 years ago (2015-12-08 19:08:48 UTC) #28
M-A Ruel
lgtm You could have had a method to create the directory; throwing from a constructor ...
5 years ago (2015-12-08 19:12:19 UTC) #29
slan
On 2015/12/08 19:12:19, M-A Ruel wrote: > You could have had a method to create ...
5 years ago (2015-12-08 19:18:07 UTC) #30
slan
https://codereview.chromium.org/1484713003/diff/60001/chromecast/base/scoped_temp_file.cc File chromecast/base/scoped_temp_file.cc (right): https://codereview.chromium.org/1484713003/diff/60001/chromecast/base/scoped_temp_file.cc#newcode32 chromecast/base/scoped_temp_file.cc:32: CHECK(FileExists()); On 2015/12/08 19:12:19, M-A Ruel wrote: > You ...
5 years ago (2015-12-08 19:18:24 UTC) #31
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1484713003/60001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1484713003/60001
5 years ago (2015-12-08 19:20:08 UTC) #34
commit-bot: I haz the power
Try jobs failed on following builders: android_chromium_gn_compile_dbg on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/android_chromium_gn_compile_dbg/builds/150845) linux_chromium_asan_rel_ng on tryserver.chromium.linux (JOB_FAILED, ...
5 years ago (2015-12-08 19:49:41 UTC) #36
slan
On 2015/12/08 19:49:41, commit-bot: I haz the power wrote: > Try jobs failed on following ...
5 years ago (2015-12-08 21:31:34 UTC) #37
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1484713003/60001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1484713003/60001
5 years ago (2015-12-08 22:54:52 UTC) #39
commit-bot: I haz the power
Committed patchset #4 (id:60001)
5 years ago (2015-12-09 00:59:39 UTC) #41
commit-bot: I haz the power
5 years ago (2015-12-09 01:00:59 UTC) #43
Message was sent while issue was closed.
Patchset 4 (id:??) landed as
https://crrev.com/ef83eab02623a35a59fe181addb2fae1b0436efc
Cr-Commit-Position: refs/heads/master@{#363875}

Powered by Google App Engine
This is Rietveld 408576698