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

Side by Side Diff: components/enhanced_bookmarks/enhanced_bookmark_model_unittest.cc

Issue 1242023005: Remove legacy StartsWithASCII function. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: y Created 5 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
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 "components/enhanced_bookmarks/enhanced_bookmark_model.h" 5 #include "components/enhanced_bookmarks/enhanced_bookmark_model.h"
6 6
7 #include "base/base64.h" 7 #include "base/base64.h"
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after
362 ASSERT_TRUE(result); 362 ASSERT_TRUE(result);
363 EXPECT_EQ(url, GURL("http://example.com/i.jpg")); 363 EXPECT_EQ(url, GURL("http://example.com/i.jpg"));
364 EXPECT_EQ(width, 33); 364 EXPECT_EQ(width, 33);
365 EXPECT_EQ(height, 44); 365 EXPECT_EQ(height, 44);
366 EXPECT_EQ("v1.0", GetVersion(node)); 366 EXPECT_EQ("v1.0", GetVersion(node));
367 } 367 }
368 368
369 TEST_F(EnhancedBookmarkModelTest, TestRemoteId) { 369 TEST_F(EnhancedBookmarkModelTest, TestRemoteId) {
370 const BookmarkNode* node = AddBookmark(); 370 const BookmarkNode* node = AddBookmark();
371 // Verify that the remote id starts with the correct prefix. 371 // Verify that the remote id starts with the correct prefix.
372 EXPECT_TRUE(base::StartsWithASCII(model_->GetRemoteId(node), "ebc_", true)); 372 EXPECT_TRUE(base::StartsWith(model_->GetRemoteId(node), "ebc_",
373 base::CompareCase::SENSITIVE));
373 374
374 // Getting the remote id for nodes that don't have them should return the 375 // Getting the remote id for nodes that don't have them should return the
375 // empty string. 376 // empty string.
376 const BookmarkNode* existing_node = 377 const BookmarkNode* existing_node =
377 bookmark_model_->AddURL(bookmark_model_->other_node(), 378 bookmark_model_->AddURL(bookmark_model_->other_node(),
378 0, 379 0,
379 base::ASCIIToUTF16("Title"), 380 base::ASCIIToUTF16("Title"),
380 GURL(GURL(BOOKMARK_URL))); 381 GURL(GURL(BOOKMARK_URL)));
381 EXPECT_TRUE(model_->GetRemoteId(existing_node).empty()); 382 EXPECT_TRUE(model_->GetRemoteId(existing_node).empty());
382 383
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after
708 EXPECT_FALSE(model_->GetOriginalImage(node, &url, &width, &height)); 709 EXPECT_FALSE(model_->GetOriginalImage(node, &url, &width, &height));
709 EXPECT_FALSE(model_->GetThumbnailImage(node, &url, &width, &height)); 710 EXPECT_FALSE(model_->GetThumbnailImage(node, &url, &width, &height));
710 711
711 std::string meta_info = GetMetaInfoField(node, "stars.imageData"); 712 std::string meta_info = GetMetaInfoField(node, "stars.imageData");
712 std::string decoded; 713 std::string decoded;
713 ASSERT_TRUE(base::Base64Decode(meta_info, &decoded)); 714 ASSERT_TRUE(base::Base64Decode(meta_info, &decoded));
714 image::collections::ImageData data; 715 image::collections::ImageData data;
715 ASSERT_TRUE(data.ParseFromString(decoded)); 716 ASSERT_TRUE(data.ParseFromString(decoded));
716 EXPECT_TRUE(data.user_removed_image()); 717 EXPECT_TRUE(data.user_removed_image());
717 } 718 }
OLDNEW
« no previous file with comments | « components/cronet/android/test/native_test_server.cc ('k') | components/favicon/core/favicon_driver_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698