summaryrefslogtreecommitdiffstats
path: root/chrome/browser/extensions/extension_geolocation_apitest.cc
diff options
context:
space:
mode:
authorjoth@chromium.org <joth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-04 11:12:43 +0000
committerjoth@chromium.org <joth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-04 11:12:43 +0000
commit10e59f313e152793f810ac60288e9a3516aba8a3 (patch)
tree092a11226e8d577aa77721efe57926e729d58fdc /chrome/browser/extensions/extension_geolocation_apitest.cc
parentc65769622ed9c97688cf0662f2cd2da77a7f5bc2 (diff)
downloadchromium_src-10e59f313e152793f810ac60288e9a3516aba8a3.zip
chromium_src-10e59f313e152793f810ac60288e9a3516aba8a3.tar.gz
chromium_src-10e59f313e152793f810ac60288e9a3516aba8a3.tar.bz2
Fix crash when permission request received from extension.
BUG=http://crbug.com/37196 TEST=TODO Review URL: http://codereview.chromium.org/667006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@40621 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/extension_geolocation_apitest.cc')
-rw-r--r--chrome/browser/extensions/extension_geolocation_apitest.cc23
1 files changed, 23 insertions, 0 deletions
diff --git a/chrome/browser/extensions/extension_geolocation_apitest.cc b/chrome/browser/extensions/extension_geolocation_apitest.cc
new file mode 100644
index 0000000..68ce380
--- /dev/null
+++ b/chrome/browser/extensions/extension_geolocation_apitest.cc
@@ -0,0 +1,23 @@
+// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/extensions/extension_apitest.h"
+#include "chrome/browser/geolocation/location_arbitrator.h"
+#include "chrome/browser/geolocation/mock_location_provider.h"
+#include "chrome/common/chrome_switches.h"
+
+class GeolocationApiTest : public ExtensionApiTest {
+public:
+ void SetUpCommandLine(CommandLine* command_line) {
+ ExtensionApiTest::SetUpCommandLine(command_line);
+ command_line->AppendSwitch(switches::kEnableGeolocation);
+ GeolocationArbitrator::SetProviderFactoryForTest(
+ &NewAutoSuccessMockLocationProvider);
+ }
+};
+
+IN_PROC_BROWSER_TEST_F(GeolocationApiTest, ExtensionGeolocationAccessFail) {
+ // Test that geolocation cannot be accessed from extension.
+ ASSERT_TRUE(RunExtensionTest("geolocation")) << message_;
+}