| 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 <ctype.h> | 5 #include <ctype.h> |
| 6 #include <string> | 6 #include <string> |
| 7 | 7 |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "chrome/browser/metrics/metrics_service.h" | 10 #include "chrome/browser/metrics/metrics_service.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 MetricsServiceTest() | 23 MetricsServiceTest() |
| 24 : ui_thread_(content::BrowserThread::UI, &message_loop_), | 24 : ui_thread_(content::BrowserThread::UI, &message_loop_), |
| 25 testing_local_state_(TestingBrowserProcess::GetGlobal()) { | 25 testing_local_state_(TestingBrowserProcess::GetGlobal()) { |
| 26 } | 26 } |
| 27 | 27 |
| 28 PrefService* GetLocalState() { | 28 PrefService* GetLocalState() { |
| 29 return testing_local_state_.Get(); | 29 return testing_local_state_.Get(); |
| 30 } | 30 } |
| 31 | 31 |
| 32 private: | 32 private: |
| 33 MessageLoopForUI message_loop_; | 33 base::MessageLoopForUI message_loop_; |
| 34 content::TestBrowserThread ui_thread_; | 34 content::TestBrowserThread ui_thread_; |
| 35 ScopedTestingLocalState testing_local_state_; | 35 ScopedTestingLocalState testing_local_state_; |
| 36 | 36 |
| 37 DISALLOW_COPY_AND_ASSIGN(MetricsServiceTest); | 37 DISALLOW_COPY_AND_ASSIGN(MetricsServiceTest); |
| 38 }; | 38 }; |
| 39 | 39 |
| 40 } // namespace | 40 } // namespace |
| 41 | 41 |
| 42 // Ensure the ClientId is formatted as expected. | 42 // Ensure the ClientId is formatted as expected. |
| 43 TEST_F(MetricsServiceTest, ClientIdCorrectlyFormatted) { | 43 TEST_F(MetricsServiceTest, ClientIdCorrectlyFormatted) { |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 { | 110 { |
| 111 CommandLine::ForCurrentProcess()->AppendSwitch( | 111 CommandLine::ForCurrentProcess()->AppendSwitch( |
| 112 switches::kResetVariationState); | 112 switches::kResetVariationState); |
| 113 | 113 |
| 114 MetricsService service; | 114 MetricsService service; |
| 115 service.GetLowEntropySource(); | 115 service.GetLowEntropySource(); |
| 116 | 116 |
| 117 EXPECT_TRUE(GetLocalState()->GetString(kCachePrefName).empty()); | 117 EXPECT_TRUE(GetLocalState()->GetString(kCachePrefName).empty()); |
| 118 } | 118 } |
| 119 } | 119 } |
| OLD | NEW |