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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 } | 57 } |
58 | 58 |
59 class ActiveTabTest : public TabContentsTestHarness { | 59 class ActiveTabTest : public TabContentsTestHarness { |
60 public: | 60 public: |
61 ActiveTabTest() | 61 ActiveTabTest() |
62 : extension(CreateTestExtension("extension", true)), | 62 : extension(CreateTestExtension("extension", true)), |
63 another_extension(CreateTestExtension("another", true)), | 63 another_extension(CreateTestExtension("another", true)), |
64 extension_without_active_tab( | 64 extension_without_active_tab( |
65 CreateTestExtension("without activeTab", false)), | 65 CreateTestExtension("without activeTab", false)), |
66 ui_thread_(BrowserThread::UI, MessageLoop::current()) { | 66 ui_thread_(BrowserThread::UI, MessageLoop::current()) { |
| 67 } |
| 68 |
| 69 virtual void SetUp() { |
| 70 TabContentsTestHarness::SetUp(); |
67 Feature::SetChannelForTesting(chrome::VersionInfo::CHANNEL_UNKNOWN); | 71 Feature::SetChannelForTesting(chrome::VersionInfo::CHANNEL_UNKNOWN); |
68 } | 72 } |
69 | 73 |
70 protected: | 74 protected: |
71 int tab_id() { | 75 int tab_id() { |
72 return tab_contents()->extension_tab_helper()->tab_id(); | 76 return tab_contents()->extension_tab_helper()->tab_id(); |
73 } | 77 } |
74 | 78 |
75 ActiveTabPermissionManager* active_tab_permission_manager() { | 79 ActiveTabPermissionManager* active_tab_permission_manager() { |
76 return tab_contents()->extension_tab_helper()-> | 80 return tab_contents()->extension_tab_helper()-> |
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
418 NavigateAndCommit(google); | 422 NavigateAndCommit(google); |
419 | 423 |
420 active_tab_permission_manager()->GrantIfRequested(extension); | 424 active_tab_permission_manager()->GrantIfRequested(extension); |
421 | 425 |
422 EXPECT_TRUE(IsAllowed(extension, google, tab_id())); | 426 EXPECT_TRUE(IsAllowed(extension, google, tab_id())); |
423 EXPECT_TRUE(IsBlocked(extension, google, tab_id() + 1)); | 427 EXPECT_TRUE(IsBlocked(extension, google, tab_id() + 1)); |
424 } | 428 } |
425 | 429 |
426 } // namespace | 430 } // namespace |
427 } // namespace extensions | 431 } // namespace extensions |
OLD | NEW |