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

Side by Side Diff: components/offline_pages/background/request_coordinator_unittest.cc

Issue 1950733002: Add unit test for request coordiator (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More CR feedback per FGorski Created 4 years, 7 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
« no previous file with comments | « components/offline_pages/background/request_coordinator.cc ('k') | no next file » | 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 2016 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 "components/offline_pages/background/request_coordinator.h"
6
7 #include "base/bind.h"
8 #include "base/memory/weak_ptr.h"
fgorski 2016/05/04 18:20:16 nit: not needed
9 #include "components/offline_pages/background/save_page_request.h"
10 #include "testing/gtest/include/gtest/gtest.h"
11
12 namespace offline_pages {
13
14 namespace {
15 // put test constants here
16 const int64_t kRequestId = 42;
17 const GURL kUrl("http://universe.com/everything");
18 const ClientId kClientId("bookmark", "1234");
19 } // namespace
20
21 class RequestCoordinatorTest
22 : public testing::Test {
23 public:
24 RequestCoordinatorTest();
25 ~RequestCoordinatorTest() override;
26
27 void CallbackFunction() {
28 }
29 };
30
31 RequestCoordinatorTest::RequestCoordinatorTest() {}
32
33 RequestCoordinatorTest::~RequestCoordinatorTest() {}
34
35 TEST_F(RequestCoordinatorTest, StartProcessingWithNoRequests) {
36 RequestCoordinator::ProcessingDoneCallback callback =
37 base::Bind(
38 &RequestCoordinatorTest::CallbackFunction,
39 base::Unretained(this));
40 RequestCoordinator coordinator;
41 EXPECT_FALSE(coordinator.StartProcessing(callback));
42 }
43
44 TEST_F(RequestCoordinatorTest, SavePageLater) {
45 RequestCoordinator coordinator;
46 SavePageRequest request(kRequestId, kUrl, kClientId, base::Time::Now());
47 EXPECT_TRUE(coordinator.SavePageLater(request));
48 }
49
50 } // namespace offline_pages
OLDNEW
« no previous file with comments | « components/offline_pages/background/request_coordinator.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698