| 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 "base/compiler_specific.h" | 5 #include "base/compiler_specific.h" |
| 6 #include "base/memory/scoped_ptr.h" | 6 #include "base/memory/scoped_ptr.h" |
| 7 #include "base/message_loop.h" | 7 #include "base/message_loop.h" |
| 8 #include "content/browser/tab_contents/tab_contents.h" | 8 #include "content/browser/tab_contents/tab_contents.h" |
| 9 #include "content/browser/tab_contents/tab_contents_delegate.h" | 9 #include "content/browser/tab_contents/tab_contents_delegate.h" |
| 10 #include "content/test/test_browser_context.h" | 10 #include "content/test/test_browser_context.h" |
| 11 #include "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
| 12 | 12 |
| 13 namespace { | 13 namespace { |
| 14 | 14 |
| 15 class MockTabContentsDelegate : public TabContentsDelegate { | 15 class MockTabContentsDelegate : public TabContentsDelegate { |
| 16 public: | 16 public: |
| 17 virtual ~MockTabContentsDelegate() {} | 17 virtual ~MockTabContentsDelegate() {} |
| 18 | 18 |
| 19 // TODO(adriansc): Remove this method when refactoring changed all call sites. | 19 // TODO(adriansc): Remove this method when refactoring changed all call sites. |
| 20 virtual TabContents* OpenURLFromTab( | 20 virtual TabContents* OpenURLFromTab( |
| 21 TabContents* source, | 21 TabContents* source, |
| 22 const GURL& url, | 22 const GURL& url, |
| 23 const GURL& referrer, | 23 const GURL& referrer, |
| 24 WindowOpenDisposition disposition, | 24 WindowOpenDisposition disposition, |
| 25 PageTransition::Type transition) OVERRIDE { | 25 content::PageTransition transition) OVERRIDE { |
| 26 return NULL; | 26 return NULL; |
| 27 } | 27 } |
| 28 | 28 |
| 29 virtual TabContents* OpenURLFromTab(TabContents* source, | 29 virtual TabContents* OpenURLFromTab(TabContents* source, |
| 30 const OpenURLParams& params) OVERRIDE { | 30 const OpenURLParams& params) OVERRIDE { |
| 31 return NULL; | 31 return NULL; |
| 32 } | 32 } |
| 33 | 33 |
| 34 virtual void NavigationStateChanged(const TabContents* source, | 34 virtual void NavigationStateChanged(const TabContents* source, |
| 35 unsigned changed_flags) OVERRIDE {} | 35 unsigned changed_flags) OVERRIDE {} |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 EXPECT_TRUE(contents_a->delegate() == NULL); | 104 EXPECT_TRUE(contents_a->delegate() == NULL); |
| 105 EXPECT_TRUE(contents_b->delegate() == NULL); | 105 EXPECT_TRUE(contents_b->delegate() == NULL); |
| 106 | 106 |
| 107 // Destroy the tab contents and run the message loop to prevent leaks. | 107 // Destroy the tab contents and run the message loop to prevent leaks. |
| 108 contents_a.reset(NULL); | 108 contents_a.reset(NULL); |
| 109 contents_b.reset(NULL); | 109 contents_b.reset(NULL); |
| 110 loop.RunAllPending(); | 110 loop.RunAllPending(); |
| 111 } | 111 } |
| 112 | 112 |
| 113 } // namespace | 113 } // namespace |
| OLD | NEW |