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

Side by Side Diff: chrome/browser/bookmarks/bookmark_codec_unittest.cc

Issue 18286004: Move PathExists to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « cc/test/paths.cc ('k') | chrome/browser/bookmarks/bookmark_storage.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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/file_util.h" 5 #include "base/file_util.h"
6 #include "base/files/file_path.h" 6 #include "base/files/file_path.h"
7 #include "base/json/json_file_value_serializer.h" 7 #include "base/json/json_file_value_serializer.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/path_service.h" 9 #include "base/path_service.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 BookmarkModelTestUtils::AssertModelsEqual(&decoded_model, 293 BookmarkModelTestUtils::AssertModelsEqual(&decoded_model,
294 &decoded_model2, 294 &decoded_model2,
295 true); 295 true);
296 } 296 }
297 297
298 TEST_F(BookmarkCodecTest, CanDecodeModelWithoutMobileBookmarks) { 298 TEST_F(BookmarkCodecTest, CanDecodeModelWithoutMobileBookmarks) {
299 base::FilePath test_data_directory; 299 base::FilePath test_data_directory;
300 ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &test_data_directory)); 300 ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &test_data_directory));
301 base::FilePath test_file = test_data_directory.AppendASCII( 301 base::FilePath test_file = test_data_directory.AppendASCII(
302 "bookmarks/model_without_sync.json"); 302 "bookmarks/model_without_sync.json");
303 ASSERT_TRUE(file_util::PathExists(test_file)); 303 ASSERT_TRUE(base::PathExists(test_file));
304 304
305 JSONFileValueSerializer serializer(test_file); 305 JSONFileValueSerializer serializer(test_file);
306 scoped_ptr<Value> root(serializer.Deserialize(NULL, NULL)); 306 scoped_ptr<Value> root(serializer.Deserialize(NULL, NULL));
307 307
308 BookmarkModel decoded_model(NULL); 308 BookmarkModel decoded_model(NULL);
309 BookmarkCodec decoder; 309 BookmarkCodec decoder;
310 ASSERT_TRUE(Decode(&decoder, &decoded_model, *root.get())); 310 ASSERT_TRUE(Decode(&decoder, &decoded_model, *root.get()));
311 ExpectIDsUnique(&decoded_model); 311 ExpectIDsUnique(&decoded_model);
312 312
313 const BookmarkNode* bbn = decoded_model.bookmark_bar_node(); 313 const BookmarkNode* bbn = decoded_model.bookmark_bar_node();
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
353 EXPECT_TRUE(model->root_node()->GetMetaInfo("model_info", &meta_value)); 353 EXPECT_TRUE(model->root_node()->GetMetaInfo("model_info", &meta_value));
354 EXPECT_EQ("value1", meta_value); 354 EXPECT_EQ("value1", meta_value);
355 EXPECT_FALSE(model->root_node()->GetMetaInfo("other_key", &meta_value)); 355 EXPECT_FALSE(model->root_node()->GetMetaInfo("other_key", &meta_value));
356 const BookmarkNode* bbn = model->bookmark_bar_node(); 356 const BookmarkNode* bbn = model->bookmark_bar_node();
357 ASSERT_EQ(1, bbn->child_count()); 357 ASSERT_EQ(1, bbn->child_count());
358 const BookmarkNode* child = bbn->GetChild(0); 358 const BookmarkNode* child = bbn->GetChild(0);
359 EXPECT_TRUE(child->GetMetaInfo("node_info", &meta_value)); 359 EXPECT_TRUE(child->GetMetaInfo("node_info", &meta_value));
360 EXPECT_EQ("value2", meta_value); 360 EXPECT_EQ("value2", meta_value);
361 EXPECT_FALSE(child->GetMetaInfo("other_key", &meta_value)); 361 EXPECT_FALSE(child->GetMetaInfo("other_key", &meta_value));
362 } 362 }
OLDNEW
« no previous file with comments | « cc/test/paths.cc ('k') | chrome/browser/bookmarks/bookmark_storage.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698