Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(25)

Side by Side Diff: chrome/browser/ui/global_error_service_browsertest.cc

Issue 10399124: Disable GlobalErrorServiceBrowserTest.BubbleViewDismissedOnRemove on Win (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_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.h"
10 #include "chrome/browser/ui/global_error_bubble_view_base.h" 10 #include "chrome/browser/ui/global_error_bubble_view_base.h"
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 115
116 // Explicitly close the bubble view. 116 // Explicitly close the bubble view.
117 EXPECT_TRUE(error->GetBubbleView()); 117 EXPECT_TRUE(error->GetBubbleView());
118 error->GetBubbleView()->CloseBubbleView(); 118 error->GetBubbleView()->CloseBubbleView();
119 ui_test_utils::RunAllPendingInMessageLoop(); 119 ui_test_utils::RunAllPendingInMessageLoop();
120 EXPECT_EQ(1, error->bubble_view_close_count()); 120 EXPECT_EQ(1, error->bubble_view_close_count());
121 } 121 }
122 122
123 // Test that bubble is silently dismissed if it is showing when the GlobalError 123 // Test that bubble is silently dismissed if it is showing when the GlobalError
124 // instance is removed from the profile. 124 // instance is removed from the profile.
125 #if defined(OS_WIN)
126 #define MAYBE_BubbleViewDismissedOnRemove DISABLED_BubbleViewDismissedOnRemove
127 #else
128 #define MAYBE_BubbleViewDismissedOnRemove BubbleViewDismissedOnRemove
129 #endif
125 IN_PROC_BROWSER_TEST_F(GlobalErrorServiceBrowserTest, 130 IN_PROC_BROWSER_TEST_F(GlobalErrorServiceBrowserTest,
126 BubbleViewDismissedOnRemove) { 131 MAYBE_BubbleViewDismissedOnRemove) {
127 scoped_ptr<BubbleViewError> error(new BubbleViewError); 132 scoped_ptr<BubbleViewError> error(new BubbleViewError);
128 133
129 GlobalErrorService* service = 134 GlobalErrorService* service =
130 GlobalErrorServiceFactory::GetForProfile(browser()->profile()); 135 GlobalErrorServiceFactory::GetForProfile(browser()->profile());
131 service->AddGlobalError(error.get()); 136 service->AddGlobalError(error.get());
132 137
133 EXPECT_EQ(error.get(), service->GetFirstGlobalErrorWithBubbleView()); 138 EXPECT_EQ(error.get(), service->GetFirstGlobalErrorWithBubbleView());
134 error->ShowBubbleView(browser()); 139 error->ShowBubbleView(browser());
135 ui_test_utils::RunAllPendingInMessageLoop(); 140 ui_test_utils::RunAllPendingInMessageLoop();
136 EXPECT_TRUE(error->HasShownBubbleView()); 141 EXPECT_TRUE(error->HasShownBubbleView());
137 EXPECT_EQ(0, error->bubble_view_close_count()); 142 EXPECT_EQ(0, error->bubble_view_close_count());
138 143
139 // Removing |error| from profile should dismiss the bubble view without 144 // Removing |error| from profile should dismiss the bubble view without
140 // calling |error->BubbleViewDidClose|. 145 // calling |error->BubbleViewDidClose|.
141 service->RemoveGlobalError(error.get()); 146 service->RemoveGlobalError(error.get());
142 ui_test_utils::RunAllPendingInMessageLoop(); 147 ui_test_utils::RunAllPendingInMessageLoop();
143 EXPECT_EQ(1, error->bubble_view_close_count()); 148 EXPECT_EQ(1, error->bubble_view_close_count());
144 // |error| is no longer owned by service and will be deleted. 149 // |error| is no longer owned by service and will be deleted.
145 } 150 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698