| OLD | NEW |
| (Empty) |
| 1 // Copyright 2006-2009 Google Inc. | |
| 2 // | |
| 3 // Licensed under the Apache License, Version 2.0 (the "License"); | |
| 4 // you may not use this file except in compliance with the License. | |
| 5 // You may obtain a copy of the License at | |
| 6 // | |
| 7 // http://www.apache.org/licenses/LICENSE-2.0 | |
| 8 // | |
| 9 // Unless required by applicable law or agreed to in writing, software | |
| 10 // distributed under the License is distributed on an "AS IS" BASIS, | |
| 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| 12 // See the License for the specific language governing permissions and | |
| 13 // limitations under the License. | |
| 14 // ======================================================================== | |
| 15 // | |
| 16 #ifndef OMAHA_STATSREPORT_AGGREGATOR_WIN32_UNITTEST_H__ | |
| 17 #define OMAHA_STATSREPORT_AGGREGATOR_WIN32_UNITTEST_H__ | |
| 18 | |
| 19 #include "aggregator_unittest.h" | |
| 20 #include "aggregator-win32.h" | |
| 21 | |
| 22 /// Shared test fixture for win32 unit tests | |
| 23 class MetricsAggregatorWin32Test: public MetricsAggregatorTest { | |
| 24 public: | |
| 25 virtual void SetUp() { | |
| 26 // clean the registry | |
| 27 SHDeleteKey(HKEY_CURRENT_USER, kRootKeyName); | |
| 28 MetricsAggregatorTest::SetUp(); | |
| 29 } | |
| 30 virtual void TearDown() { | |
| 31 MetricsAggregatorTest::TearDown(); | |
| 32 SHDeleteKey(HKEY_CURRENT_USER, kRootKeyName); | |
| 33 } | |
| 34 | |
| 35 void AddStats() { | |
| 36 ++c1_; | |
| 37 ++c2_; | |
| 38 ++c2_; | |
| 39 | |
| 40 t1_.AddSample(1000); | |
| 41 t1_.AddSample(500); | |
| 42 | |
| 43 t2_.AddSample(2000); | |
| 44 t2_.AddSample(30); | |
| 45 | |
| 46 i1_ = 1; | |
| 47 i2_ = 2; | |
| 48 | |
| 49 b1_ = true; | |
| 50 b2_ = false; | |
| 51 } | |
| 52 | |
| 53 static const wchar_t kAppName[]; | |
| 54 static const wchar_t kRootKeyName[]; | |
| 55 static const wchar_t kCountsKeyName[]; | |
| 56 static const wchar_t kTimingsKeyName[]; | |
| 57 static const wchar_t kIntegersKeyName[]; | |
| 58 static const wchar_t kBoolsKeyName[]; | |
| 59 }; | |
| 60 | |
| 61 #endif // OMAHA_STATSREPORT_AGGREGATOR_WIN32_UNITTEST_H__ | |
| OLD | NEW |