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

Side by Side Diff: content/public/test/browser_test_utils.h

Issue 818263004: Add a test that is a repro case for bug 444945. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@autofill_crash'
Patch Set: Nasko's fixes Created 5 years, 12 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
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 #ifndef CONTENT_PUBLIC_TEST_BROWSER_TEST_UTILS_H_ 5 #ifndef CONTENT_PUBLIC_TEST_BROWSER_TEST_UTILS_H_
6 #define CONTENT_PUBLIC_TEST_BROWSER_TEST_UTILS_H_ 6 #define CONTENT_PUBLIC_TEST_BROWSER_TEST_UTILS_H_
7 7
8 #include <queue> 8 #include <queue>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after
344 const NotificationDetails& details) override; 344 const NotificationDetails& details) override;
345 345
346 private: 346 private:
347 NotificationRegistrar registrar_; 347 NotificationRegistrar registrar_;
348 std::queue<std::string> message_queue_; 348 std::queue<std::string> message_queue_;
349 scoped_refptr<MessageLoopRunner> message_loop_runner_; 349 scoped_refptr<MessageLoopRunner> message_loop_runner_;
350 350
351 DISALLOW_COPY_AND_ASSIGN(DOMMessageQueue); 351 DISALLOW_COPY_AND_ASSIGN(DOMMessageQueue);
352 }; 352 };
353 353
354 // Used to wait for a new WebContents to be created. Instantiate this object
355 // before the operation that will create the window.
356 class WebContentsAddedObserver {
357 public:
358 WebContentsAddedObserver();
359 ~WebContentsAddedObserver();
360
361 // Will run a message loop to wait for the new window if it hasn't been
362 // created since the constructor
363 WebContents* GetWebContents();
364
365 // Will tell whether RenderViewCreated Callback has invoked
366 bool RenderViewCreatedCalled();
367
368 private:
369 class RenderViewCreatedObserver;
370
371 void WebContentsCreated(WebContents* web_contents);
372
373 // Callback to WebContentCreated(). Cached so that we can unregister it.
374 base::Callback<void(WebContents*)> web_contents_created_callback_;
375
376 WebContents* web_contents_;
377 scoped_ptr<RenderViewCreatedObserver> child_observer_;
378 scoped_refptr<MessageLoopRunner> runner_;
379
380 DISALLOW_COPY_AND_ASSIGN(WebContentsAddedObserver);
381 };
382
354 } // namespace content 383 } // namespace content
355 384
356 #endif // CONTENT_PUBLIC_TEST_BROWSER_TEST_UTILS_H_ 385 #endif // CONTENT_PUBLIC_TEST_BROWSER_TEST_UTILS_H_
OLDNEW
« no previous file with comments | « chrome/browser/task_manager/task_manager_browsertest.cc ('k') | content/public/test/browser_test_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698