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

Side by Side Diff: trunk/src/content/common/page_state_serialization_unittest.cc

Issue 105823009: Revert 239280 "Move more file_util functions to base namespace." (Closed) Base URL: svn://svn.chromium.org/chrome/
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 <math.h> 5 #include <math.h>
6 6
7 #include "base/base64.h" 7 #include "base/base64.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/path_service.h" 9 #include "base/path_service.h"
10 #include "base/pickle.h" 10 #include "base/pickle.h"
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
372 std::string encoded; 372 std::string encoded;
373 EXPECT_TRUE(EncodePageState(state, &encoded)); 373 EXPECT_TRUE(EncodePageState(state, &encoded));
374 374
375 std::string base64; 375 std::string base64;
376 EXPECT_TRUE(base::Base64Encode(encoded, &base64)); 376 EXPECT_TRUE(base::Base64Encode(encoded, &base64));
377 377
378 base::FilePath path; 378 base::FilePath path;
379 PathService::Get(base::DIR_TEMP, &path); 379 PathService::Get(base::DIR_TEMP, &path);
380 path = path.AppendASCII("expected.dat"); 380 path = path.AppendASCII("expected.dat");
381 381
382 FILE* fp = base::OpenFile(path, "wb"); 382 FILE* fp = file_util::OpenFile(path, "wb");
383 ASSERT_TRUE(fp); 383 ASSERT_TRUE(fp);
384 384
385 const size_t kRowSize = 76; 385 const size_t kRowSize = 76;
386 for (size_t offset = 0; offset < base64.size(); offset += kRowSize) { 386 for (size_t offset = 0; offset < base64.size(); offset += kRowSize) {
387 size_t length = std::min(base64.size() - offset, kRowSize); 387 size_t length = std::min(base64.size() - offset, kRowSize);
388 std::string segment(&base64[offset], length); 388 std::string segment(&base64[offset], length);
389 segment.push_back('\n'); 389 segment.push_back('\n');
390 ASSERT_EQ(1U, fwrite(segment.data(), segment.size(), 1, fp)); 390 ASSERT_EQ(1U, fwrite(segment.data(), segment.size(), 1, fp));
391 } 391 }
392 392
(...skipping 23 matching lines...) Expand all
416 TEST_F(PageStateSerializationTest, BackwardsCompat_v15) { 416 TEST_F(PageStateSerializationTest, BackwardsCompat_v15) {
417 TestBackwardsCompat(15); 417 TestBackwardsCompat(15);
418 } 418 }
419 419
420 TEST_F(PageStateSerializationTest, BackwardsCompat_v16) { 420 TEST_F(PageStateSerializationTest, BackwardsCompat_v16) {
421 TestBackwardsCompat(16); 421 TestBackwardsCompat(16);
422 } 422 }
423 423
424 } // namespace 424 } // namespace
425 } // namespace content 425 } // namespace content
OLDNEW
« no previous file with comments | « trunk/src/content/common/mac/font_loader.mm ('k') | trunk/src/content/common/plugin_list_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698