| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "chrome/browser/extensions/extension_apitest.h" | 5 #include "chrome/browser/extensions/extension_apitest.h" |
| 6 #include "chrome/browser/geolocation/location_arbitrator.h" | 6 #include "chrome/browser/geolocation/location_arbitrator.h" |
| 7 #include "chrome/browser/geolocation/mock_location_provider.h" | 7 #include "chrome/browser/geolocation/mock_location_provider.h" |
| 8 #include "chrome/common/chrome_switches.h" | 8 #include "chrome/common/chrome_switches.h" |
| 9 | 9 |
| 10 class GeolocationApiTest : public ExtensionApiTest { | 10 class GeolocationApiTest : public ExtensionApiTest { |
| 11 public: | 11 public: |
| 12 // InProcessBrowserTest | 12 // InProcessBrowserTest |
| 13 void SetUpInProcessBrowserTestFixture() { | 13 void SetUpInProcessBrowserTestFixture() { |
| 14 ExtensionApiTest::SetUpInProcessBrowserTestFixture(); | 14 ExtensionApiTest::SetUpInProcessBrowserTestFixture(); |
| 15 GeolocationArbitrator::SetProviderFactoryForTest( | 15 GeolocationArbitrator::SetProviderFactoryForTest( |
| 16 &NewAutoSuccessMockLocationProvider); | 16 &NewAutoSuccessMockLocationProvider); |
| 17 } | 17 } |
| 18 }; | 18 }; |
| 19 | 19 |
| 20 IN_PROC_BROWSER_TEST_F(GeolocationApiTest, ExtensionGeolocationAccessFail) { | 20 IN_PROC_BROWSER_TEST_F(GeolocationApiTest, FLAKY_ExtensionGeolocationAccessFail)
{ |
| 21 // Test that geolocation cannot be accessed from extension without permission. | 21 // Test that geolocation cannot be accessed from extension without permission. |
| 22 ASSERT_TRUE(RunExtensionTest("geolocation/no_permission")) << message_; | 22 ASSERT_TRUE(RunExtensionTest("geolocation/no_permission")) << message_; |
| 23 } | 23 } |
| 24 | 24 |
| 25 IN_PROC_BROWSER_TEST_F(GeolocationApiTest, ExtensionGeolocationAccessPass) { | 25 IN_PROC_BROWSER_TEST_F(GeolocationApiTest, ExtensionGeolocationAccessPass) { |
| 26 // Test that geolocation can be accessed from extension with permission. | 26 // Test that geolocation can be accessed from extension with permission. |
| 27 ASSERT_TRUE(RunExtensionTest("geolocation/has_permission")) << message_; | 27 ASSERT_TRUE(RunExtensionTest("geolocation/has_permission")) << message_; |
| 28 } | 28 } |
| OLD | NEW |