| 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 <string> | 5 #include <string> |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/file_path.h" | 8 #include "base/file_path.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "base/stl_util.h" | 11 #include "base/stl_util.h" |
| 12 #include "base/string16.h" | 12 #include "base/string16.h" |
| 13 #include "base/time.h" | 13 #include "base/time.h" |
| 14 #include "base/values.h" | 14 #include "base/values.h" |
| 15 #include "chrome/browser/download/download_query.h" | 15 #include "chrome/browser/download/download_query.h" |
| 16 #include "content/test/mock_download_item.h" | 16 #include "content/public/test/mock_download_item.h" |
| 17 #include "testing/gmock/include/gmock/gmock.h" | 17 #include "testing/gmock/include/gmock/gmock.h" |
| 18 #include "testing/gtest/include/gtest/gtest.h" | 18 #include "testing/gtest/include/gtest/gtest.h" |
| 19 | 19 |
| 20 using ::testing::Return; | 20 using ::testing::Return; |
| 21 using ::testing::ReturnRef; | 21 using ::testing::ReturnRef; |
| 22 using ::testing::_; | 22 using ::testing::_; |
| 23 using base::Time; | 23 using base::Time; |
| 24 using base::Value; | 24 using base::Value; |
| 25 using content::DownloadItem; | 25 using content::DownloadItem; |
| 26 typedef DownloadQuery::DownloadVector DownloadVector; | 26 typedef DownloadQuery::DownloadVector DownloadVector; |
| (...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 390 base::Time start = base::Time::Now(); | 390 base::Time start = base::Time::Now(); |
| 391 Search(); | 391 Search(); |
| 392 base::Time end = base::Time::Now(); | 392 base::Time end = base::Time::Now(); |
| 393 double nanos = (end - start).InMillisecondsF() * 1000.0 * 1000.0; | 393 double nanos = (end - start).InMillisecondsF() * 1000.0 * 1000.0; |
| 394 double nanos_per_item = nanos / static_cast<double>(kNumItems); | 394 double nanos_per_item = nanos / static_cast<double>(kNumItems); |
| 395 double nanos_per_item_per_filter = nanos_per_item | 395 double nanos_per_item_per_filter = nanos_per_item |
| 396 / static_cast<double>(kNumFilters); | 396 / static_cast<double>(kNumFilters); |
| 397 std::cout << "Search took " << nanos_per_item_per_filter | 397 std::cout << "Search took " << nanos_per_item_per_filter |
| 398 << " nanoseconds per item per filter.\n"; | 398 << " nanoseconds per item per filter.\n"; |
| 399 } | 399 } |
| OLD | NEW |