[email protected] | 4d245165 | 2012-02-14 23:54:26 | [diff] [blame] | 1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
[email protected] | 10e59f313 | 2010-03-04 11:12:43 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
3 | // found in the LICENSE file. | ||||
4 | |||||
5 | #include "chrome/browser/extensions/extension_apitest.h" | ||||
[email protected] | 02a5fe29 | 2012-04-25 21:47:56 | [diff] [blame] | 6 | #include "chrome/test/base/ui_test_utils.h" |
[email protected] | 10e59f313 | 2010-03-04 11:12:43 | [diff] [blame] | 7 | |
8 | class GeolocationApiTest : public ExtensionApiTest { | ||||
[email protected] | 0bc24b5 | 2011-01-11 01:19:47 | [diff] [blame] | 9 | public: |
[email protected] | f7f9819 | 2012-01-24 17:10:26 | [diff] [blame] | 10 | GeolocationApiTest() { |
[email protected] | 10e59f313 | 2010-03-04 11:12:43 | [diff] [blame] | 11 | } |
[email protected] | b7d6acc | 2011-02-03 11:01:50 | [diff] [blame] | 12 | |
13 | // InProcessBrowserTest | ||||
[email protected] | 02a5fe29 | 2012-04-25 21:47:56 | [diff] [blame] | 14 | virtual void SetUpOnMainThread() { |
15 | ui_test_utils::OverrideGeolocation(0, 0); | ||||
[email protected] | b7d6acc | 2011-02-03 11:01:50 | [diff] [blame] | 16 | } |
[email protected] | 10e59f313 | 2010-03-04 11:12:43 | [diff] [blame] | 17 | }; |
18 | |||||
[email protected] | 4d245165 | 2012-02-14 23:54:26 | [diff] [blame] | 19 | // http://crbug.com/68287 |
[email protected] | 0bc24b5 | 2011-01-11 01:19:47 | [diff] [blame] | 20 | IN_PROC_BROWSER_TEST_F(GeolocationApiTest, |
[email protected] | 4d245165 | 2012-02-14 23:54:26 | [diff] [blame] | 21 | DISABLED_ExtensionGeolocationAccessFail) { |
[email protected] | 5ab79b0 | 2010-04-26 16:47:11 | [diff] [blame] | 22 | // Test that geolocation cannot be accessed from extension without permission. |
23 | ASSERT_TRUE(RunExtensionTest("geolocation/no_permission")) << message_; | ||||
24 | } | ||||
25 | |||||
[email protected] | dea2cca | 2012-05-21 20:33:32 | [diff] [blame^] | 26 | // Timing out. http://crbug.com/128412 |
[email protected] | 6e74bf99 | 2012-05-17 11:21:20 | [diff] [blame] | 27 | IN_PROC_BROWSER_TEST_F(GeolocationApiTest, |
[email protected] | dea2cca | 2012-05-21 20:33:32 | [diff] [blame^] | 28 | DISABLED_ExtensionGeolocationAccessPass) { |
[email protected] | 5ab79b0 | 2010-04-26 16:47:11 | [diff] [blame] | 29 | // Test that geolocation can be accessed from extension with permission. |
30 | ASSERT_TRUE(RunExtensionTest("geolocation/has_permission")) << message_; | ||||
[email protected] | 10e59f313 | 2010-03-04 11:12:43 | [diff] [blame] | 31 | } |