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

Side by Side Diff: chrome/browser/ui/login/login_prompt_browsertest.cc

Issue 6156008: Additional logging for LoginPromptBrowserTest.IncorrectConfirmation (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Created 9 years, 11 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 <algorithm> 5 #include <algorithm>
6 #include <list> 6 #include <list>
7 #include <map> 7 #include <map>
8 8
9 #include "chrome/browser/browser_thread.h" 9 #include "chrome/browser/browser_thread.h"
10 #include "chrome/browser/ui/browser.h" 10 #include "chrome/browser/ui/browser.h"
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 269
270 EXPECT_EQ(kMultiRealmTestRealmCount, n_handlers); 270 EXPECT_EQ(kMultiRealmTestRealmCount, n_handlers);
271 EXPECT_LT(0, observer.auth_needed_count_); 271 EXPECT_LT(0, observer.auth_needed_count_);
272 EXPECT_LT(0, observer.auth_supplied_count_); 272 EXPECT_LT(0, observer.auth_supplied_count_);
273 EXPECT_EQ(0, observer.auth_cancelled_count_); 273 EXPECT_EQ(0, observer.auth_cancelled_count_);
274 EXPECT_TRUE(test_server()->Stop()); 274 EXPECT_TRUE(test_server()->Stop());
275 } 275 }
276 276
277 // Testing for recovery from an incorrect password for the case where 277 // Testing for recovery from an incorrect password for the case where
278 // there are multiple authenticated resources. 278 // there are multiple authenticated resources.
279 // Marked as flaky. See crbug.com/68860 279 // Marked as flaky. See crbug.com/69266 and http://crbug.com/68860
cbentzel 2011/01/12 15:04:25 Nit: use full URL for 69266.
280 // TODO(asanka): Remove logging when timeout issues are resolved.
280 IN_PROC_BROWSER_TEST_F(LoginPromptBrowserTest, FLAKY_IncorrectConfirmation) { 281 IN_PROC_BROWSER_TEST_F(LoginPromptBrowserTest, FLAKY_IncorrectConfirmation) {
281 ASSERT_TRUE(test_server()->Start()); 282 ASSERT_TRUE(test_server()->Start());
282 GURL test_page = test_server()->GetURL(kSingleRealmTestPage); 283 GURL test_page = test_server()->GetURL(kSingleRealmTestPage);
283 284
284 TabContentsWrapper* contents = 285 TabContentsWrapper* contents =
285 browser()->GetSelectedTabContentsWrapper(); 286 browser()->GetSelectedTabContentsWrapper();
286 ASSERT_TRUE(contents); 287 ASSERT_TRUE(contents);
287 288
288 NavigationController* controller = &contents->controller(); 289 NavigationController* controller = &contents->controller();
289 LoginPromptBrowserTestObserver observer; 290 LoginPromptBrowserTestObserver observer;
290 291
291 observer.Register(Source<NavigationController>(controller)); 292 observer.Register(Source<NavigationController>(controller));
292 293
293 WindowedLoadStopObserver load_stop_waiter(controller); 294 WindowedLoadStopObserver load_stop_waiter(controller);
294 295
296 LOG(INFO) << "Begin";
295 { 297 {
296 WindowedAuthNeededObserver auth_needed_waiter(controller); 298 WindowedAuthNeededObserver auth_needed_waiter(controller);
297 browser()->OpenURL(test_page, GURL(), CURRENT_TAB, PageTransition::TYPED); 299 browser()->OpenURL(test_page, GURL(), CURRENT_TAB, PageTransition::TYPED);
300 LOG(INFO) << "Waiting for initial AUTH_NEEDED";
298 auth_needed_waiter.Wait(); 301 auth_needed_waiter.Wait();
299 } 302 }
300 303
301 EXPECT_FALSE(observer.handlers_.empty()); 304 EXPECT_FALSE(observer.handlers_.empty());
302 305
303 if (!observer.handlers_.empty()) { 306 if (!observer.handlers_.empty()) {
304 WindowedAuthNeededObserver auth_needed_waiter(controller); 307 WindowedAuthNeededObserver auth_needed_waiter(controller);
305 WindowedAuthSuppliedObserver auth_supplied_waiter(controller); 308 WindowedAuthSuppliedObserver auth_supplied_waiter(controller);
306 LoginHandler* handler = *observer.handlers_.begin(); 309 LoginHandler* handler = *observer.handlers_.begin();
307 310
308 ASSERT_TRUE(handler); 311 ASSERT_TRUE(handler);
309 handler->SetAuth(bad_username_, bad_password_); 312 handler->SetAuth(bad_username_, bad_password_);
313 LOG(INFO) << "Waiting for initial AUTH_SUPPLIED";
310 auth_supplied_waiter.Wait(); 314 auth_supplied_waiter.Wait();
311 315
312 // The request should be retried after the incorrect password is 316 // The request should be retried after the incorrect password is
313 // supplied. This should result in a new AUTH_NEEDED notification 317 // supplied. This should result in a new AUTH_NEEDED notification
314 // for the same realm. 318 // for the same realm.
319 LOG(INFO) << "Waiting for secondary AUTH_NEEDED";
315 auth_needed_waiter.Wait(); 320 auth_needed_waiter.Wait();
316 } 321 }
317 322
318 int n_handlers = 0; 323 int n_handlers = 0;
319 324
320 while (n_handlers < 1) { 325 while (n_handlers < 1) {
321 WindowedAuthNeededObserver auth_needed_waiter(controller); 326 WindowedAuthNeededObserver auth_needed_waiter(controller);
322 327
323 while (!observer.handlers_.empty()) { 328 while (!observer.handlers_.empty()) {
324 WindowedAuthSuppliedObserver auth_supplied_waiter(controller); 329 WindowedAuthSuppliedObserver auth_supplied_waiter(controller);
325 LoginHandler* handler = *observer.handlers_.begin(); 330 LoginHandler* handler = *observer.handlers_.begin();
326 331
327 ASSERT_TRUE(handler); 332 ASSERT_TRUE(handler);
328 n_handlers++; 333 n_handlers++;
329 SetAuthFor(handler); 334 SetAuthFor(handler);
335 LOG(INFO) << "Waiting for secondary AUTH_SUPPLIED";
330 auth_supplied_waiter.Wait(); 336 auth_supplied_waiter.Wait();
331 } 337 }
332 338
333 if (n_handlers < 1) 339 if (n_handlers < 1) {
340 LOG(INFO) << "Waiting for additional AUTH_NEEDED";
334 auth_needed_waiter.Wait(); 341 auth_needed_waiter.Wait();
342 }
335 } 343 }
336 344
345 LOG(INFO) << "Waiting for LOAD_STOP";
337 load_stop_waiter.Wait(); 346 load_stop_waiter.Wait();
338 347
339 // The single realm test has only one realm, and thus only one login 348 // The single realm test has only one realm, and thus only one login
340 // prompt. 349 // prompt.
341 EXPECT_EQ(1, n_handlers); 350 EXPECT_EQ(1, n_handlers);
342 EXPECT_LT(0, observer.auth_needed_count_); 351 EXPECT_LT(0, observer.auth_needed_count_);
343 EXPECT_LT(0, observer.auth_supplied_count_);
344 EXPECT_EQ(0, observer.auth_cancelled_count_); 352 EXPECT_EQ(0, observer.auth_cancelled_count_);
353 EXPECT_EQ(observer.auth_needed_count_, observer.auth_supplied_count_);
cbentzel 2011/01/11 19:40:34 Was this added for a stronger test?
asanka 2011/01/11 21:58:05 Yeah. With the current state of the code, we shou
345 EXPECT_TRUE(test_server()->Stop()); 354 EXPECT_TRUE(test_server()->Stop());
355 LOG(INFO) << "Done";
346 } 356 }
347 } // namespace 357 } // namespace
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