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

Side by Side Diff: content/test/fileapi_test_file_set.cc

Issue 1499423004: Remove kint32max. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@kint9
Patch Set: rebase Created 5 years 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "content/test/fileapi_test_file_set.h" 5 #include "content/test/fileapi_test_file_set.h"
6 6
7 #include <stdint.h>
8
9 #include <limits>
7 #include <string> 10 #include <string>
8 11
9 #include "base/files/file.h" 12 #include "base/files/file.h"
10 #include "base/files/file_util.h" 13 #include "base/files/file_util.h"
11 #include "base/logging.h" 14 #include "base/logging.h"
12 #include "base/rand_util.h" 15 #include "base/rand_util.h"
13 #include "testing/gtest/include/gtest/gtest.h" 16 #include "testing/gtest/include/gtest/gtest.h"
14 17
15 namespace content { 18 namespace content {
16 19
(...skipping 26 matching lines...) Expand all
43 base::FilePath path = root_path.Append(test_case.path); 46 base::FilePath path = root_path.Append(test_case.path);
44 if (test_case.is_directory) { 47 if (test_case.is_directory) {
45 ASSERT_TRUE(base::CreateDirectory(path)); 48 ASSERT_TRUE(base::CreateDirectory(path));
46 return; 49 return;
47 } 50 }
48 base::File file(path, 51 base::File file(path,
49 base::File::FLAG_CREATE_ALWAYS | base::File::FLAG_WRITE); 52 base::File::FLAG_CREATE_ALWAYS | base::File::FLAG_WRITE);
50 ASSERT_TRUE(file.IsValid()); 53 ASSERT_TRUE(file.IsValid());
51 if (test_case.data_file_size) { 54 if (test_case.data_file_size) {
52 std::string content = base::RandBytesAsString(test_case.data_file_size); 55 std::string content = base::RandBytesAsString(test_case.data_file_size);
53 EXPECT_LE(test_case.data_file_size, kint32max); 56 EXPECT_LE(test_case.data_file_size, std::numeric_limits<int32_t>::max());
54 ASSERT_EQ(static_cast<int>(content.size()), 57 ASSERT_EQ(static_cast<int>(content.size()),
55 file.Write(0, content.data(), static_cast<int>(content.size()))); 58 file.Write(0, content.data(), static_cast<int>(content.size())));
56 } 59 }
57 } 60 }
58 61
59 62
60 void SetUpRegularFileSystemTestCases(const base::FilePath& root_path) { 63 void SetUpRegularFileSystemTestCases(const base::FilePath& root_path) {
61 for (size_t i = 0; i < arraysize(kRegularFileSystemTestCases); ++i) { 64 for (size_t i = 0; i < arraysize(kRegularFileSystemTestCases); ++i) {
62 SCOPED_TRACE(testing::Message() << "Creating kRegularTestCases " << i); 65 SCOPED_TRACE(testing::Message() << "Creating kRegularTestCases " << i);
63 SetUpOneFileSystemTestCase(root_path, kRegularFileSystemTestCases[i]); 66 SetUpOneFileSystemTestCase(root_path, kRegularFileSystemTestCases[i]);
64 } 67 }
65 } 68 }
66 69
67 } // namespace content 70 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/dom_storage/dom_storage_cached_area.cc ('k') | media/base/android/media_codec_bridge.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698