| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/browser/diagnostics/diagnostics_model.h" | 5 #include "chrome/browser/diagnostics/diagnostics_model.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
| 9 | 9 |
| 10 // Basic harness to adquire and release the Diagnostic model object. | 10 // Basic harness to adquire and release the Diagnostic model object. |
| 11 class DiagnosticsModelTest : public testing::Test { | 11 class DiagnosticsModelTest : public testing::Test { |
| 12 protected: | 12 protected: |
| 13 DiagnosticsModelTest() | 13 DiagnosticsModelTest() |
| 14 : model_(NULL), | 14 : model_(NULL), |
| 15 cmdline_(CommandLine::ARGUMENTS_ONLY) { | 15 cmdline_(CommandLine::NO_PROGRAM) { |
| 16 } | 16 } |
| 17 | 17 |
| 18 virtual ~DiagnosticsModelTest() { } | 18 virtual ~DiagnosticsModelTest() { } |
| 19 | 19 |
| 20 virtual void SetUp() { | 20 virtual void SetUp() { |
| 21 model_ = MakeDiagnosticsModel(cmdline_); | 21 model_ = MakeDiagnosticsModel(cmdline_); |
| 22 ASSERT_TRUE(model_ != NULL); | 22 ASSERT_TRUE(model_ != NULL); |
| 23 } | 23 } |
| 24 | 24 |
| 25 virtual void TearDown() { | 25 virtual void TearDown() { |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 // final state is correct. | 97 // final state is correct. |
| 98 TEST_F(DiagnosticsModelTest, RunAll) { | 98 TEST_F(DiagnosticsModelTest, RunAll) { |
| 99 UTObserver observer; | 99 UTObserver observer; |
| 100 EXPECT_FALSE(observer.done()); | 100 EXPECT_FALSE(observer.done()); |
| 101 model_->RunAll(&observer); | 101 model_->RunAll(&observer); |
| 102 EXPECT_TRUE(observer.done()); | 102 EXPECT_TRUE(observer.done()); |
| 103 EXPECT_GT(observer.progress_called(), 0); | 103 EXPECT_GT(observer.progress_called(), 0); |
| 104 EXPECT_EQ(kDiagnosticsTestCount, model_->GetTestRunCount()); | 104 EXPECT_EQ(kDiagnosticsTestCount, model_->GetTestRunCount()); |
| 105 EXPECT_EQ(kDiagnosticsTestCount, observer.finished()); | 105 EXPECT_EQ(kDiagnosticsTestCount, observer.finished()); |
| 106 } | 106 } |
| OLD | NEW |