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

Side by Side Diff: components/rappor/rappor_recorder_unittest.cc

Issue 49753002: RAPPOR implementation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "components/rappor/rappor_recorder.h"
6 #include "components/rappor/rappor.h"
7
8 #include "testing/gtest/include/gtest/gtest.h"
9
10 namespace rappor {
11
12 TEST(RapporRecorderTest, TestRecorder) {
13 RapporRecorder recorder;
14
15 Rappor* rappor = recorder.GetRappor("MyRappor");
16 ASSERT_TRUE(rappor);
17
18 Rappor* rappor2 = recorder.GetRappor("MyRappor2");
19 ASSERT_NE(rappor, rappor2);
20
21 Rappor* rappor1 = recorder.GetRappor("MyRappor");
22 ASSERT_EQ(rappor, rappor1);
23
24 RapporRecorder::Rappors rappors;
25 recorder.GetRappors(&rappors);
26 ASSERT_EQ(rappors.size(), 2u);
27
28 recorder.ClearRappors();
29 RapporRecorder::Rappors rappors_cleared;
30 recorder.GetRappors(&rappors_cleared);
31 ASSERT_EQ(rappors_cleared.size(), 0u);
32 }
33
34 } // namespace rappor
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698