| 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/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
| 8 #include "chrome/browser/ui/browser.h" | 8 #include "chrome/browser/ui/browser.h" |
| 9 #include "chrome/browser/ui/global_error.h" | 9 #include "chrome/browser/ui/global_error/global_error.h" |
| 10 #include "chrome/browser/ui/global_error_bubble_view_base.h" | 10 #include "chrome/browser/ui/global_error/global_error_bubble_view_base.h" |
| 11 #include "chrome/browser/ui/global_error_service_factory.h" | 11 #include "chrome/browser/ui/global_error/global_error_service_factory.h" |
| 12 #include "chrome/test/base/in_process_browser_test.h" | 12 #include "chrome/test/base/in_process_browser_test.h" |
| 13 #include "chrome/test/base/ui_test_utils.h" | 13 #include "chrome/test/base/ui_test_utils.h" |
| 14 | 14 |
| 15 namespace { | 15 namespace { |
| 16 | 16 |
| 17 // An error that has a bubble view. | 17 // An error that has a bubble view. |
| 18 class BubbleViewError : public GlobalError { | 18 class BubbleViewError : public GlobalError { |
| 19 public: | 19 public: |
| 20 BubbleViewError() : bubble_view_close_count_(0) { } | 20 BubbleViewError() : bubble_view_close_count_(0) { } |
| 21 | 21 |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 EXPECT_TRUE(error->HasShownBubbleView()); | 141 EXPECT_TRUE(error->HasShownBubbleView()); |
| 142 EXPECT_EQ(0, error->bubble_view_close_count()); | 142 EXPECT_EQ(0, error->bubble_view_close_count()); |
| 143 | 143 |
| 144 // Removing |error| from profile should dismiss the bubble view without | 144 // Removing |error| from profile should dismiss the bubble view without |
| 145 // calling |error->BubbleViewDidClose|. | 145 // calling |error->BubbleViewDidClose|. |
| 146 service->RemoveGlobalError(error.get()); | 146 service->RemoveGlobalError(error.get()); |
| 147 ui_test_utils::RunAllPendingInMessageLoop(); | 147 ui_test_utils::RunAllPendingInMessageLoop(); |
| 148 EXPECT_EQ(1, error->bubble_view_close_count()); | 148 EXPECT_EQ(1, error->bubble_view_close_count()); |
| 149 // |error| is no longer owned by service and will be deleted. | 149 // |error| is no longer owned by service and will be deleted. |
| 150 } | 150 } |
| OLD | NEW |