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

Side by Side Diff: chrome/browser/predictors/autocomplete_action_predictor_unittest.cc

Issue 655413002: Convert ARRAYSIZE_UNSAFE -> arraysize in chrome/browser/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 (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 "chrome/browser/predictors/autocomplete_action_predictor.h" 5 #include "chrome/browser/predictors/autocomplete_action_predictor.h"
6 6
7 #include "base/auto_reset.h" 7 #include "base/auto_reset.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/guid.h" 9 #include "base/guid.h"
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 EXPECT_EQ(in_expected, in_list); 347 EXPECT_EQ(in_expected, in_list);
348 } 348 }
349 } 349 }
350 350
351 TEST_F(AutocompleteActionPredictorTest, RecommendActionURL) { 351 TEST_F(AutocompleteActionPredictorTest, RecommendActionURL) {
352 ASSERT_NO_FATAL_FAILURE(AddAllRows()); 352 ASSERT_NO_FATAL_FAILURE(AddAllRows());
353 353
354 AutocompleteMatch match; 354 AutocompleteMatch match;
355 match.type = AutocompleteMatchType::HISTORY_URL; 355 match.type = AutocompleteMatchType::HISTORY_URL;
356 356
357 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(test_url_db); ++i) { 357 for (size_t i = 0; i < arraysize(test_url_db); ++i) {
358 match.destination_url = GURL(test_url_db[i].url); 358 match.destination_url = GURL(test_url_db[i].url);
359 EXPECT_EQ(test_url_db[i].expected_action, 359 EXPECT_EQ(test_url_db[i].expected_action,
360 predictor()->RecommendAction(test_url_db[i].user_text, match)) 360 predictor()->RecommendAction(test_url_db[i].user_text, match))
361 << "Unexpected action for " << match.destination_url; 361 << "Unexpected action for " << match.destination_url;
362 } 362 }
363 } 363 }
364 364
365 TEST_F(AutocompleteActionPredictorTest, RecommendActionSearch) { 365 TEST_F(AutocompleteActionPredictorTest, RecommendActionSearch) {
366 ASSERT_NO_FATAL_FAILURE(AddAllRows()); 366 ASSERT_NO_FATAL_FAILURE(AddAllRows());
367 367
368 AutocompleteMatch match; 368 AutocompleteMatch match;
369 match.type = AutocompleteMatchType::SEARCH_WHAT_YOU_TYPED; 369 match.type = AutocompleteMatchType::SEARCH_WHAT_YOU_TYPED;
370 370
371 for (size_t i = 0; i < arraysize(test_url_db); ++i) { 371 for (size_t i = 0; i < arraysize(test_url_db); ++i) {
372 match.destination_url = GURL(test_url_db[i].url); 372 match.destination_url = GURL(test_url_db[i].url);
373 AutocompleteActionPredictor::Action expected_action = 373 AutocompleteActionPredictor::Action expected_action =
374 (test_url_db[i].expected_action == 374 (test_url_db[i].expected_action ==
375 AutocompleteActionPredictor::ACTION_PRERENDER) ? 375 AutocompleteActionPredictor::ACTION_PRERENDER) ?
376 AutocompleteActionPredictor::ACTION_PRECONNECT : 376 AutocompleteActionPredictor::ACTION_PRECONNECT :
377 test_url_db[i].expected_action; 377 test_url_db[i].expected_action;
378 EXPECT_EQ(expected_action, 378 EXPECT_EQ(expected_action,
379 predictor()->RecommendAction(test_url_db[i].user_text, match)) 379 predictor()->RecommendAction(test_url_db[i].user_text, match))
380 << "Unexpected action for " << match.destination_url; 380 << "Unexpected action for " << match.destination_url;
381 } 381 }
382 } 382 }
383 383
384 } // namespace predictors 384 } // namespace predictors
OLDNEW
« no previous file with comments | « chrome/browser/password_manager/password_store_mac_unittest.cc ('k') | chrome/browser/prefs/chrome_pref_service_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698