Index: content/browser/accessibility/dump_accessibility_tree_browsertest.cc |
diff --git a/content/browser/accessibility/dump_accessibility_tree_browsertest.cc b/content/browser/accessibility/dump_accessibility_tree_browsertest.cc |
index b1c7d98d1357d83f57706fb40f70631bd1e70472..9b47dfb408bcbcd55aa88a43bd3ef8bb01f57a67 100644 |
--- a/content/browser/accessibility/dump_accessibility_tree_browsertest.cc |
+++ b/content/browser/accessibility/dump_accessibility_tree_browsertest.cc |
@@ -18,6 +18,8 @@ |
#include "content/browser/accessibility/dump_accessibility_tree_helper.h" |
#include "content/browser/renderer_host/render_view_host_impl.h" |
#include "content/port/browser/render_widget_host_view_port.h" |
+#include "content/public/browser/notification_service.h" |
+#include "content/public/browser/notification_types.h" |
#include "content/public/browser/web_contents.h" |
#include "content/public/common/content_paths.h" |
#include "content/public/test/test_utils.h" |
@@ -26,16 +28,14 @@ |
#include "content/shell/shell.h" |
#include "testing/gtest/include/gtest/gtest.h" |
-namespace content { |
- |
namespace { |
+ static const char kCommentToken = '#'; |
+ static const char* kMarkSkipFile = "#<skip"; |
+ static const char* kMarkEndOfFile = "<-- End-of-file -->"; |
+ static const char* kSignalDiff = "*"; |
+} // namespace |
-const char kCommentToken = '#'; |
-const char kMarkSkipFile[] = "#<skip"; |
-const char kMarkEndOfFile[] = "<-- End-of-file -->"; |
-const char kSignalDiff[] = "*"; |
- |
-} // namespace |
+namespace content { |
typedef DumpAccessibilityTreeHelper::Filter Filter; |
@@ -166,17 +166,17 @@ void DumpAccessibilityTreeTest::RunTest( |
} |
// Load the page. |
+ WindowedNotificationObserver tree_updated_observer( |
+ NOTIFICATION_ACCESSIBILITY_LOAD_COMPLETE, |
+ NotificationService::AllSources()); |
string16 html_contents16; |
html_contents16 = UTF8ToUTF16(html_contents); |
GURL url = GetTestUrl("accessibility", |
html_file.BaseName().MaybeAsASCII().c_str()); |
- scoped_refptr<MessageLoopRunner> loop_runner(new MessageLoopRunner); |
- view_host->SetAccessibilityLoadCompleteCallbackForTesting( |
- loop_runner->QuitClosure()); |
NavigateToURL(shell(), url); |
// Wait for the tree. |
- loop_runner->Run(); |
+ tree_updated_observer.Wait(); |
// Perform a diff (or write the initial baseline). |
string16 actual_contents_utf16; |