| OLD | NEW |
| 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 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 336 all_ids.begin(); | 336 all_ids.begin(); |
| 337 it != all_ids.end(); ++it) { | 337 it != all_ids.end(); ++it) { |
| 338 bool in_expected = | 338 bool in_expected = |
| 339 (std::find(expected.begin(), expected.end(), *it) != expected.end()); | 339 (std::find(expected.begin(), expected.end(), *it) != expected.end()); |
| 340 bool in_list = | 340 bool in_list = |
| 341 (std::find(id_list.begin(), id_list.end(), *it) != id_list.end()); | 341 (std::find(id_list.begin(), id_list.end(), *it) != id_list.end()); |
| 342 EXPECT_EQ(in_expected, in_list); | 342 EXPECT_EQ(in_expected, in_list); |
| 343 } | 343 } |
| 344 } | 344 } |
| 345 | 345 |
| 346 TEST_F(AutocompleteActionPredictorTest, RecommendActionURL) { | 346 TEST_F(AutocompleteActionPredictorTest, DISABLED_RecommendActionURL) { |
| 347 ASSERT_NO_FATAL_FAILURE(AddAllRows()); | 347 ASSERT_NO_FATAL_FAILURE(AddAllRows()); |
| 348 | 348 |
| 349 AutocompleteMatch match; | 349 AutocompleteMatch match; |
| 350 match.type = AutocompleteMatch::HISTORY_URL; | 350 match.type = AutocompleteMatch::HISTORY_URL; |
| 351 | 351 |
| 352 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(test_url_db); ++i) { | 352 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(test_url_db); ++i) { |
| 353 match.destination_url = GURL(test_url_db[i].url); | 353 match.destination_url = GURL(test_url_db[i].url); |
| 354 EXPECT_EQ(test_url_db[i].expected_action, | 354 EXPECT_EQ(test_url_db[i].expected_action, |
| 355 predictor()->RecommendAction(test_url_db[i].user_text, match)) | 355 predictor()->RecommendAction(test_url_db[i].user_text, match)) |
| 356 << "Unexpected action for " << match.destination_url; | 356 << "Unexpected action for " << match.destination_url; |
| (...skipping 13 matching lines...) Expand all Loading... |
| 370 AutocompleteActionPredictor::ACTION_PRERENDER) ? | 370 AutocompleteActionPredictor::ACTION_PRERENDER) ? |
| 371 AutocompleteActionPredictor::ACTION_PRECONNECT : | 371 AutocompleteActionPredictor::ACTION_PRECONNECT : |
| 372 test_url_db[i].expected_action; | 372 test_url_db[i].expected_action; |
| 373 EXPECT_EQ(expected_action, | 373 EXPECT_EQ(expected_action, |
| 374 predictor()->RecommendAction(test_url_db[i].user_text, match)) | 374 predictor()->RecommendAction(test_url_db[i].user_text, match)) |
| 375 << "Unexpected action for " << match.destination_url; | 375 << "Unexpected action for " << match.destination_url; |
| 376 } | 376 } |
| 377 } | 377 } |
| 378 | 378 |
| 379 } // namespace predictors | 379 } // namespace predictors |
| OLD | NEW |