| 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 "chrome/browser/ui/global_error_service.h" | 5 #include "chrome/browser/ui/global_error/global_error_service.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "chrome/browser/ui/global_error.h" | 9 #include "chrome/browser/ui/global_error/global_error.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| 11 | 11 |
| 12 namespace { | 12 namespace { |
| 13 | 13 |
| 14 // Error base class that keeps track of the number of errors that exist. | 14 // Error base class that keeps track of the number of errors that exist. |
| 15 class BaseError : public GlobalError { | 15 class BaseError : public GlobalError { |
| 16 public: | 16 public: |
| 17 BaseError() { ++count_; } | 17 BaseError() { ++count_; } |
| 18 virtual ~BaseError() { --count_; } | 18 virtual ~BaseError() { --count_; } |
| 19 | 19 |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 EXPECT_EQ(2, service.GetFirstBadgeResourceID()); | 186 EXPECT_EQ(2, service.GetFirstBadgeResourceID()); |
| 187 | 187 |
| 188 service.AddGlobalError(error3); | 188 service.AddGlobalError(error3); |
| 189 EXPECT_EQ(2, service.GetFirstBadgeResourceID()); | 189 EXPECT_EQ(2, service.GetFirstBadgeResourceID()); |
| 190 | 190 |
| 191 // Remove the first error with a badge. | 191 // Remove the first error with a badge. |
| 192 service.RemoveGlobalError(&error2); | 192 service.RemoveGlobalError(&error2); |
| 193 // Now error3 should be the first error with a badge. | 193 // Now error3 should be the first error with a badge. |
| 194 EXPECT_EQ(3, service.GetFirstBadgeResourceID()); | 194 EXPECT_EQ(3, service.GetFirstBadgeResourceID()); |
| 195 } | 195 } |
| OLD | NEW |