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

Side by Side Diff: content/browser/renderer_host/pepper/quota_file_io_unittest.cc

Issue 99923002: Move temp file functions to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 | Annotate | Revision Log
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 <deque> 5 #include <deque>
6 #include <limits> 6 #include <limits>
7 #include <string> 7 #include <string>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 class QuotaFileIOTest : public PpapiUnittest { 82 class QuotaFileIOTest : public PpapiUnittest {
83 public: 83 public:
84 QuotaFileIOTest() 84 QuotaFileIOTest()
85 : delegate_(NULL), 85 : delegate_(NULL),
86 weak_factory_(this) {} 86 weak_factory_(this) {}
87 87
88 virtual void SetUp() OVERRIDE { 88 virtual void SetUp() OVERRIDE {
89 PpapiUnittest::SetUp(); 89 PpapiUnittest::SetUp();
90 ASSERT_TRUE(dir_.CreateUniqueTempDir()); 90 ASSERT_TRUE(dir_.CreateUniqueTempDir());
91 base::FilePath path; 91 base::FilePath path;
92 ASSERT_TRUE(file_util::CreateTemporaryFileInDir(dir_.path(), &path)); 92 ASSERT_TRUE(base::CreateTemporaryFileInDir(dir_.path(), &path));
93 int file_flags = base::PLATFORM_FILE_OPEN | 93 int file_flags = base::PLATFORM_FILE_OPEN |
94 base::PLATFORM_FILE_READ | 94 base::PLATFORM_FILE_READ |
95 base::PLATFORM_FILE_WRITE | 95 base::PLATFORM_FILE_WRITE |
96 base::PLATFORM_FILE_WRITE_ATTRIBUTES; 96 base::PLATFORM_FILE_WRITE_ATTRIBUTES;
97 bool created = false; 97 bool created = false;
98 file_ = base::kInvalidPlatformFileValue; 98 file_ = base::kInvalidPlatformFileValue;
99 PlatformFileError error = base::PLATFORM_FILE_OK; 99 PlatformFileError error = base::PLATFORM_FILE_OK;
100 file_ = base::CreatePlatformFile(path, file_flags, &created, &error); 100 file_ = base::CreatePlatformFile(path, file_flags, &created, &error);
101 ASSERT_EQ(base::PLATFORM_FILE_OK, error); 101 ASSERT_EQ(base::PLATFORM_FILE_OK, error);
102 ASSERT_NE(base::kInvalidPlatformFileValue, file_); 102 ASSERT_NE(base::kInvalidPlatformFileValue, file_);
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after
417 EXPECT_EQ(base::PLATFORM_FILE_ERROR_NO_SPACE, status().front()); 417 EXPECT_EQ(base::PLATFORM_FILE_ERROR_NO_SPACE, status().front());
418 pop_result(); 418 pop_result();
419 419
420 EXPECT_EQ(22 - 15, delegate()->available_space()); 420 EXPECT_EQ(22 - 15, delegate()->available_space());
421 EXPECT_EQ(15, GetPlatformFileSize()); 421 EXPECT_EQ(15, GetPlatformFileSize());
422 ReadPlatformFile(&read_buffer); 422 ReadPlatformFile(&read_buffer);
423 EXPECT_EQ("123355559012345", read_buffer); 423 EXPECT_EQ("123355559012345", read_buffer);
424 } 424 }
425 425
426 } // namespace content 426 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698