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

Side by Side Diff: content/browser/download/download_query_unittest.cc

Issue 7825035: Implement chrome.experimental.downloads.search() (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: rewrite Created 9 years, 1 month 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 | « content/browser/download/download_query.cc ('k') | content/content_browser.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "base/stl_util.h"
6 #include "content/browser/download/download_query.h"
7 #include "testing/gtest/include/gtest/gtest.h"
8
9 using download_util::DownloadQuery;
10 typedef DownloadQuery::DownloadVector DownloadVector;
11
12 #if 0
13 class MockDownloadItem : public DownloadItemInterface {
14 public:
15 };
16 #endif
17
18 class DownloadQueryTest : public testing::Test {
19 public:
20 DownloadQueryTest() {}
21 virtual ~DownloadQueryTest() {}
22 virtual void TearDown() {
23 STLDeleteElements(&all_items_);
24 }
25 DownloadQuery* query() { return &query_; }
26 DownloadVector* all_items() { return &all_items_; }
27 DownloadVector* results() { return &results_; }
28 void Search() {
29 query()->Search(all_items_.begin(), all_items_.end(), &results_);
30 }
31
32 private:
33 DownloadQuery query_;
34 DownloadVector all_items_;
35 DownloadVector results_;
36
37 DISALLOW_COPY_AND_ASSIGN(DownloadQueryTest);
38 };
39
40 TEST_F(DownloadQueryTest, EmptyQueryNoItems) {
41 Search();
42 EXPECT_EQ(0U, results()->size());
43 }
44
45 TEST_F(DownloadQueryTest, EmptyQuerySomeItems) {
46 #if 0
47 all_items()->push_back(new MockDownloadItem(0));
48 all_items()->push_back(new MockDownloadItem(1));
49 all_items()->push_back(new MockDownloadItem(2));
50 #endif
51 Search();
52 EXPECT_EQ(3U, results()->size());
53 }
OLDNEW
« no previous file with comments | « content/browser/download/download_query.cc ('k') | content/content_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698