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 <string> | 5 #include <string> |
6 | 6 |
7 #include "base/file_path.h" | 7 #include "base/file_path.h" |
8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
9 #include "base/string16.h" | 9 #include "base/string16.h" |
10 #include "base/stringprintf.h" | 10 #include "base/stringprintf.h" |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 } | 46 } |
47 | 47 |
48 private: | 48 private: |
49 content::NotificationRegistrar registrar_; | 49 content::NotificationRegistrar registrar_; |
50 | 50 |
51 DISALLOW_COPY_AND_ASSIGN(MockNotificationObserver); | 51 DISALLOW_COPY_AND_ASSIGN(MockNotificationObserver); |
52 }; | 52 }; |
53 | 53 |
54 class AutomationTabHelperBrowserTest : public InProcessBrowserTest { | 54 class AutomationTabHelperBrowserTest : public InProcessBrowserTest { |
55 public: | 55 public: |
56 AutomationTabHelperBrowserTest() { | 56 AutomationTabHelperBrowserTest() {} |
57 EnableDOMAutomation(); | 57 virtual ~AutomationTabHelperBrowserTest() {} |
58 } | |
59 virtual ~AutomationTabHelperBrowserTest() { } | |
60 | 58 |
61 void SetUpInProcessBrowserTestFixture() { | 59 void SetUpInProcessBrowserTestFixture() { |
62 EXPECT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &test_data_dir_)); | 60 EXPECT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &test_data_dir_)); |
63 test_data_dir_ = test_data_dir_.AppendASCII("automation"); | 61 test_data_dir_ = test_data_dir_.AppendASCII("automation"); |
64 } | 62 } |
65 | 63 |
66 // Add default expectations for a client redirection initiated by script, | 64 // Add default expectations for a client redirection initiated by script, |
67 // and quit the message loop when the redirect has completed. This expects | 65 // and quit the message loop when the redirect has completed. This expects |
68 // that the tab receives news of the redirect before the script returns. | 66 // that the tab receives news of the redirect before the script returns. |
69 void ExpectClientRedirectAndBreak( | 67 void ExpectClientRedirectAndBreak( |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 IN_PROC_BROWSER_TEST_F(AutomationTabHelperBrowserTest, | 206 IN_PROC_BROWSER_TEST_F(AutomationTabHelperBrowserTest, |
209 CrashedTabStopsLoading) { | 207 CrashedTabStopsLoading) { |
210 MockTabEventObserver mock_tab_observer(tab_helper()); | 208 MockTabEventObserver mock_tab_observer(tab_helper()); |
211 | 209 |
212 testing::InSequence expect_in_sequence; | 210 testing::InSequence expect_in_sequence; |
213 EXPECT_CALL(mock_tab_observer, OnFirstPendingLoad(_)); | 211 EXPECT_CALL(mock_tab_observer, OnFirstPendingLoad(_)); |
214 EXPECT_CALL(mock_tab_observer, OnNoMorePendingLoads(_)); | 212 EXPECT_CALL(mock_tab_observer, OnNoMorePendingLoads(_)); |
215 | 213 |
216 ui_test_utils::NavigateToURL(browser(), GURL(chrome::kChromeUICrashURL)); | 214 ui_test_utils::NavigateToURL(browser(), GURL(chrome::kChromeUICrashURL)); |
217 } | 215 } |
OLD | NEW |