| 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/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "base/values.h" | 10 #include "base/values.h" |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 .SetID(id) | 52 .SetID(id) |
| 53 .Build(); | 53 .Build(); |
| 54 } | 54 } |
| 55 | 55 |
| 56 class ActiveTabTest : public ChromeRenderViewHostTestHarness { | 56 class ActiveTabTest : public ChromeRenderViewHostTestHarness { |
| 57 public: | 57 public: |
| 58 ActiveTabTest() | 58 ActiveTabTest() |
| 59 : extension(CreateTestExtension("deadbeef", true)), | 59 : extension(CreateTestExtension("deadbeef", true)), |
| 60 another_extension(CreateTestExtension("feedbeef", true)), | 60 another_extension(CreateTestExtension("feedbeef", true)), |
| 61 extension_without_active_tab(CreateTestExtension("badbeef", false)), | 61 extension_without_active_tab(CreateTestExtension("badbeef", false)), |
| 62 ui_thread_(BrowserThread::UI, MessageLoop::current()) {} | 62 ui_thread_(BrowserThread::UI, base::MessageLoop::current()) {} |
| 63 | 63 |
| 64 protected: | 64 protected: |
| 65 virtual void SetUp() OVERRIDE { | 65 virtual void SetUp() OVERRIDE { |
| 66 ChromeRenderViewHostTestHarness::SetUp(); | 66 ChromeRenderViewHostTestHarness::SetUp(); |
| 67 TabHelper::CreateForWebContents(web_contents()); | 67 TabHelper::CreateForWebContents(web_contents()); |
| 68 } | 68 } |
| 69 | 69 |
| 70 int tab_id() { | 70 int tab_id() { |
| 71 return SessionID::IdForTab(web_contents()); | 71 return SessionID::IdForTab(web_contents()); |
| 72 } | 72 } |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 320 Reload(); | 320 Reload(); |
| 321 | 321 |
| 322 EXPECT_FALSE(IsAllowed(extension, google, tab_id())); | 322 EXPECT_FALSE(IsAllowed(extension, google, tab_id())); |
| 323 EXPECT_FALSE(IsAllowed(extension, google_h1, tab_id())); | 323 EXPECT_FALSE(IsAllowed(extension, google_h1, tab_id())); |
| 324 EXPECT_FALSE(IsAllowed(extension, chromium, tab_id())); | 324 EXPECT_FALSE(IsAllowed(extension, chromium, tab_id())); |
| 325 EXPECT_FALSE(IsAllowed(extension, chromium_h1, tab_id())); | 325 EXPECT_FALSE(IsAllowed(extension, chromium_h1, tab_id())); |
| 326 } | 326 } |
| 327 | 327 |
| 328 } // namespace | 328 } // namespace |
| 329 } // namespace extensions | 329 } // namespace extensions |
| OLD | NEW |