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 "chrome/browser/extensions/api/identity/identity_api.h" | 5 #include "chrome/browser/extensions/api/identity/identity_api.h" |
6 #include "chrome/browser/extensions/extension_apitest.h" | 6 #include "chrome/browser/extensions/extension_apitest.h" |
7 #include "chrome/common/net/gaia/google_service_auth_error.h" | 7 #include "chrome/common/net/gaia/google_service_auth_error.h" |
8 #include "chrome/common/net/gaia/oauth2_mint_token_flow.h" | 8 #include "chrome/common/net/gaia/oauth2_mint_token_flow.h" |
9 #include "chrome/common/chrome_switches.h" | 9 #include "chrome/common/chrome_switches.h" |
10 | 10 |
(...skipping 10 matching lines...) Expand all Loading... |
21 } | 21 } |
22 | 22 |
23 bool get_auth_token_called() const { return get_auth_token_called_; } | 23 bool get_auth_token_called() const { return get_auth_token_called_; } |
24 | 24 |
25 private: | 25 private: |
26 bool get_auth_token_called_; | 26 bool get_auth_token_called_; |
27 }; | 27 }; |
28 | 28 |
29 } // namespace | 29 } // namespace |
30 | 30 |
31 class ExperimentalApiTest : public ExtensionApiTest { | 31 class ExperimentalApiTest : public PlatformAppApiTest { |
32 public: | |
33 void SetUpCommandLine(CommandLine* command_line) { | |
34 ExtensionApiTest::SetUpCommandLine(command_line); | |
35 command_line->AppendSwitch(switches::kEnablePlatformApps); | |
36 command_line->AppendSwitch(switches::kEnableExperimentalExtensionApis); | |
37 } | |
38 }; | 32 }; |
39 | 33 |
| 34 IN_PROC_BROWSER_TEST_F(ExperimentalApiTest, VerifyPermissions) { |
| 35 VerifyPermissions(test_data_dir_.AppendASCII("identity")); |
| 36 } |
| 37 |
40 IN_PROC_BROWSER_TEST_F(ExperimentalApiTest, Identity) { | 38 IN_PROC_BROWSER_TEST_F(ExperimentalApiTest, Identity) { |
41 IdentityInterceptor interceptor; | 39 IdentityInterceptor interceptor; |
42 OAuth2MintTokenFlow::SetInterceptorForTests(&interceptor); | 40 OAuth2MintTokenFlow::SetInterceptorForTests(&interceptor); |
43 ASSERT_TRUE(RunExtensionTest("identity")) << message_; | 41 ASSERT_TRUE(RunExtensionTest("identity")) << message_; |
44 ASSERT_TRUE(interceptor.get_auth_token_called()); | 42 ASSERT_TRUE(interceptor.get_auth_token_called()); |
45 }; | 43 }; |
OLD | NEW |