| OLD | NEW | 
|---|
| 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 <map> | 5 #include <map> | 
| 6 | 6 | 
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" | 
| 8 #include "chrome/browser/automation/automation_tab_helper.h" | 8 #include "chrome/browser/automation/automation_tab_helper.h" | 
| 9 #include "chrome/browser/automation/mock_tab_event_observer.h" | 9 #include "chrome/browser/automation/mock_tab_event_observer.h" | 
| 10 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 10 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 
| 11 #include "chrome/browser/ui/tab_contents/test_tab_contents_wrapper.h" | 11 #include "chrome/browser/ui/tab_contents/test_tab_contents_wrapper.h" | 
| 12 #include "content/browser/tab_contents/tab_contents.h" | 12 #include "content/browser/tab_contents/tab_contents.h" | 
| 13 #include "content/browser/tab_contents/test_tab_contents.h" | 13 #include "content/browser/tab_contents/test_tab_contents.h" | 
| 14 #include "content/test/test_browser_thread.h" | 14 #include "content/test/test_browser_thread.h" | 
| 15 #include "testing/gmock/include/gmock/gmock.h" | 15 #include "testing/gmock/include/gmock/gmock.h" | 
| 16 #include "testing/gtest/include/gtest/gtest.h" | 16 #include "testing/gtest/include/gtest/gtest.h" | 
| 17 | 17 | 
|  | 18 using content::BrowserThread; | 
| 18 using testing::_; | 19 using testing::_; | 
| 19 | 20 | 
| 20 class AutomationTabHelperTest : public TabContentsWrapperTestHarness { | 21 class AutomationTabHelperTest : public TabContentsWrapperTestHarness { | 
| 21  public: | 22  public: | 
| 22   AutomationTabHelperTest() | 23   AutomationTabHelperTest() | 
| 23       : TabContentsWrapperTestHarness(), | 24       : TabContentsWrapperTestHarness(), | 
| 24         browser_thread_(BrowserThread::UI, &message_loop_) {} | 25         browser_thread_(BrowserThread::UI, &message_loop_) {} | 
| 25 | 26 | 
| 26   virtual void SetUp() { | 27   virtual void SetUp() { | 
| 27     TabContentsWrapperTestHarness::SetUp(); | 28     TabContentsWrapperTestHarness::SetUp(); | 
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 205 | 206 | 
| 206   testing::InSequence expect_in_sequence; | 207   testing::InSequence expect_in_sequence; | 
| 207   EXPECT_CALL(mock_observer_, OnFirstPendingLoad(contents())); | 208   EXPECT_CALL(mock_observer_, OnFirstPendingLoad(contents())); | 
| 208   EXPECT_CALL(mock_observer_, OnNoMorePendingLoads(contents())); | 209   EXPECT_CALL(mock_observer_, OnNoMorePendingLoads(contents())); | 
| 209 | 210 | 
| 210   StartLoading(); | 211   StartLoading(); | 
| 211   WillPerformClientRedirect(1); | 212   WillPerformClientRedirect(1); | 
| 212   TabContentsDestroyed(); | 213   TabContentsDestroyed(); | 
| 213   EXPECT_FALSE(tab_helper()->has_pending_loads()); | 214   EXPECT_FALSE(tab_helper()->has_pending_loads()); | 
| 214 } | 215 } | 
| OLD | NEW | 
|---|