| 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 "base/logging.h" | 5 #include "base/logging.h" |
| 6 #include "chrome/browser/extensions/extension_apitest.h" | 6 #include "chrome/browser/extensions/extension_apitest.h" |
| 7 #include "chrome/browser/extensions/extension_service.h" | 7 #include "chrome/browser/extensions/extension_service.h" |
| 8 #include "chrome/browser/extensions/extension_system.h" | 8 #include "chrome/browser/extensions/extension_system.h" |
| 9 #include "chrome/browser/ui/browser.h" | 9 #include "chrome/browser/ui/browser.h" |
| 10 #include "chrome/common/extensions/extension.h" | 10 #include "chrome/common/extensions/extension.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 ui_test_utils::NavigateToURL( | 36 ui_test_utils::NavigateToURL( |
| 37 browser(), | 37 browser(), |
| 38 embedded_test_server()->GetURL( | 38 embedded_test_server()->GetURL( |
| 39 "/extensions/api_test/active_tab/page.html")); | 39 "/extensions/api_test/active_tab/page.html")); |
| 40 EXPECT_TRUE(catcher.GetNextResult()) << message_; | 40 EXPECT_TRUE(catcher.GetNextResult()) << message_; |
| 41 } | 41 } |
| 42 | 42 |
| 43 // Granting to the extension should give it access to page.html. | 43 // Granting to the extension should give it access to page.html. |
| 44 { | 44 { |
| 45 ResultCatcher catcher; | 45 ResultCatcher catcher; |
| 46 service->toolbar_model()->ExecuteBrowserAction(extension, browser(), NULL); | 46 service->toolbar_model()->ExecuteBrowserAction( |
| 47 extension, browser(), NULL, true); |
| 47 EXPECT_TRUE(catcher.GetNextResult()) << message_; | 48 EXPECT_TRUE(catcher.GetNextResult()) << message_; |
| 48 } | 49 } |
| 49 | 50 |
| 50 // Changing page should go back to it not having access. | 51 // Changing page should go back to it not having access. |
| 51 { | 52 { |
| 52 ResultCatcher catcher; | 53 ResultCatcher catcher; |
| 53 ui_test_utils::NavigateToURL( | 54 ui_test_utils::NavigateToURL( |
| 54 browser(), | 55 browser(), |
| 55 embedded_test_server()->GetURL( | 56 embedded_test_server()->GetURL( |
| 56 "/extensions/api_test/active_tab/final_page.html")); | 57 "/extensions/api_test/active_tab/final_page.html")); |
| 57 EXPECT_TRUE(catcher.GetNextResult()) << message_; | 58 EXPECT_TRUE(catcher.GetNextResult()) << message_; |
| 58 } | 59 } |
| 59 } | 60 } |
| 60 | 61 |
| 61 } // namespace | 62 } // namespace |
| 62 } // namespace extensions | 63 } // namespace extensions |
| OLD | NEW |