Lines Matching refs:func

413     scoped_refptr<IdentityGetAccountsFunction> func(
415 func->set_extension(test_util::CreateEmptyExtension(kExtensionId).get());
417 func.get(), std::string("[]"), browser(), utils::NONE)) {
421 const base::ListValue* callback_arguments = func->GetResultList();
534 scoped_refptr<IdentityGetProfileUserInfoFunction> func(
536 func->set_extension(test_util::CreateEmptyExtension(kExtensionId).get());
538 utils::RunFunctionAndReturnSingleResult(func.get(), "[]", browser()));
543 scoped_refptr<IdentityGetProfileUserInfoFunction> func(
545 func->set_extension(CreateExtensionWithEmailPermission());
547 utils::RunFunctionAndReturnSingleResult(func.get(), "[]", browser()));
752 scoped_refptr<FakeGetAuthTokenFunction> func(new FakeGetAuthTokenFunction());
753 func->set_extension(CreateExtension(SCOPES));
755 func.get(), "[{}]", browser());
757 EXPECT_FALSE(func->login_ui_shown());
758 EXPECT_FALSE(func->scope_ui_shown());
763 scoped_refptr<FakeGetAuthTokenFunction> func(new FakeGetAuthTokenFunction());
764 func->set_extension(CreateExtension(CLIENT_ID));
766 func.get(), "[{}]", browser());
768 EXPECT_FALSE(func->login_ui_shown());
769 EXPECT_FALSE(func->scope_ui_shown());
774 scoped_refptr<FakeGetAuthTokenFunction> func(new FakeGetAuthTokenFunction());
775 func->set_extension(CreateExtension(CLIENT_ID | SCOPES));
777 func.get(), "[{}]", browser());
779 EXPECT_FALSE(func->login_ui_shown());
780 EXPECT_FALSE(func->scope_ui_shown());
786 scoped_refptr<FakeGetAuthTokenFunction> func(new FakeGetAuthTokenFunction());
787 func->set_extension(CreateExtension(CLIENT_ID | SCOPES));
788 func->set_mint_token_result(TestOAuth2MintTokenFlow::MINT_TOKEN_FAILURE);
790 utils::RunFunctionAndReturnError(func.get(), "[{}]", browser());
792 EXPECT_FALSE(func->login_ui_shown());
793 EXPECT_FALSE(func->scope_ui_shown());
799 scoped_refptr<FakeGetAuthTokenFunction> func(new FakeGetAuthTokenFunction());
800 func->set_extension(CreateExtension(CLIENT_ID | SCOPES));
801 func->set_login_access_token_result(false);
803 func.get(), "[{}]", browser());
811 scoped_refptr<FakeGetAuthTokenFunction> func(new FakeGetAuthTokenFunction());
812 func->set_extension(extension.get());
813 func->set_mint_token_result(TestOAuth2MintTokenFlow::ISSUE_ADVICE_SUCCESS);
815 utils::RunFunctionAndReturnError(func.get(), "[{}]", browser());
817 EXPECT_FALSE(func->login_ui_shown());
818 EXPECT_FALSE(func->scope_ui_shown());
827 scoped_refptr<FakeGetAuthTokenFunction> func(new FakeGetAuthTokenFunction());
828 func->set_extension(CreateExtension(CLIENT_ID | SCOPES));
829 func->set_mint_token_result(
832 utils::RunFunctionAndReturnError(func.get(), "[{}]", browser());
834 EXPECT_FALSE(func->login_ui_shown());
835 EXPECT_FALSE(func->scope_ui_shown());
841 scoped_refptr<FakeGetAuthTokenFunction> func(new FakeGetAuthTokenFunction());
842 func->set_extension(CreateExtension(CLIENT_ID | SCOPES));
843 func->set_mint_token_result(
846 utils::RunFunctionAndReturnError(func.get(), "[{}]", browser());
848 EXPECT_FALSE(func->login_ui_shown());
849 EXPECT_FALSE(func->scope_ui_shown());
861 scoped_refptr<FakeGetAuthTokenFunction> func(new FakeGetAuthTokenFunction());
863 func->set_extension(extension.get());
864 func->set_mint_token_result(TestOAuth2MintTokenFlow::MINT_TOKEN_SUCCESS);
866 utils::RunFunctionAndReturnSingleResult(func.get(), "[]", browser()));
870 EXPECT_FALSE(func->login_ui_shown());
871 EXPECT_FALSE(func->scope_ui_shown());
885 scoped_refptr<FakeGetAuthTokenFunction> func(new FakeGetAuthTokenFunction());
887 func->set_extension(extension.get());
888 func->set_mint_token_result(TestOAuth2MintTokenFlow::MINT_TOKEN_SUCCESS);
890 func.get(), "[{}]", browser()));
894 EXPECT_FALSE(func->login_ui_shown());
895 EXPECT_FALSE(func->scope_ui_shown());
902 scoped_refptr<FakeGetAuthTokenFunction> func(new FakeGetAuthTokenFunction());
903 func->set_extension(CreateExtension(CLIENT_ID | SCOPES));
904 func->set_login_ui_result(false);
906 func.get(), "[{\"interactive\": true}]", browser());
908 EXPECT_TRUE(func->login_ui_shown());
909 EXPECT_FALSE(func->scope_ui_shown());
915 scoped_refptr<FakeGetAuthTokenFunction> func(new FakeGetAuthTokenFunction());
916 func->set_extension(CreateExtension(CLIENT_ID | SCOPES));
917 func->set_mint_token_result(
919 func->set_login_ui_result(false);
921 func.get(), "[{\"interactive\": true}]", browser());
923 EXPECT_TRUE(func->login_ui_shown());
924 EXPECT_FALSE(func->scope_ui_shown());
929 scoped_refptr<FakeGetAuthTokenFunction> func(new FakeGetAuthTokenFunction());
930 func->set_extension(CreateExtension(CLIENT_ID | SCOPES));
931 func->set_login_ui_result(false);
933 func.get(), "[{\"interactive\": true}]", browser());
935 EXPECT_TRUE(func->login_ui_shown());
936 EXPECT_FALSE(func->scope_ui_shown());
941 scoped_refptr<FakeGetAuthTokenFunction> func(new FakeGetAuthTokenFunction());
942 func->set_extension(CreateExtension(CLIENT_ID | SCOPES));
943 func->set_login_ui_result(true);
944 func->set_mint_token_result(TestOAuth2MintTokenFlow::MINT_TOKEN_FAILURE);
946 func.get(), "[{\"interactive\": true}]", browser());
948 EXPECT_TRUE(func->login_ui_shown());
949 EXPECT_FALSE(func->scope_ui_shown());
954 scoped_refptr<FakeGetAuthTokenFunction> func(new FakeGetAuthTokenFunction());
955 func->set_extension(CreateExtension(CLIENT_ID | SCOPES));
956 func->set_login_ui_result(true);
957 func->set_login_access_token_result(false);
959 func.get(), "[{\"interactive\": true}]", browser());
961 EXPECT_TRUE(func->login_ui_shown());
962 EXPECT_FALSE(func->scope_ui_shown());
969 scoped_refptr<FakeGetAuthTokenFunction> func(new FakeGetAuthTokenFunction());
970 func->set_extension(CreateExtension(CLIENT_ID | SCOPES));
971 func->set_login_ui_result(true);
972 func->set_mint_token_result(TestOAuth2MintTokenFlow::MINT_TOKEN_SUCCESS);
974 func.get(), "[{\"interactive\": true}]", browser()));
978 EXPECT_TRUE(func->login_ui_shown());
979 EXPECT_FALSE(func->scope_ui_shown());
984 scoped_refptr<FakeGetAuthTokenFunction> func(new FakeGetAuthTokenFunction());
985 func->set_extension(CreateExtension(CLIENT_ID | SCOPES));
986 func->set_login_ui_result(true);
987 func->set_mint_token_result(TestOAuth2MintTokenFlow::ISSUE_ADVICE_SUCCESS);
988 func->set_scope_ui_failure(GaiaWebAuthFlow::WINDOW_CLOSED);
990 func.get(), "[{\"interactive\": true}]", browser());
992 EXPECT_TRUE(func->login_ui_shown());
993 EXPECT_TRUE(func->scope_ui_shown());
999 scoped_refptr<FakeGetAuthTokenFunction> func(new FakeGetAuthTokenFunction());
1000 func->set_extension(extension.get());
1001 func->set_login_ui_result(true);
1002 func->set_mint_token_result(TestOAuth2MintTokenFlow::ISSUE_ADVICE_SUCCESS);
1005 func.get(), "[{\"interactive\": true}]", browser()));
1009 EXPECT_TRUE(func->login_ui_shown());
1010 EXPECT_TRUE(func->scope_ui_shown());
1016 scoped_refptr<FakeGetAuthTokenFunction> func(new FakeGetAuthTokenFunction());
1017 func->set_extension(CreateExtension(CLIENT_ID | SCOPES));
1018 func->set_mint_token_result(TestOAuth2MintTokenFlow::ISSUE_ADVICE_SUCCESS);
1019 func->set_scope_ui_failure(GaiaWebAuthFlow::WINDOW_CLOSED);
1021 func.get(), "[{\"interactive\": true}]", browser());
1023 EXPECT_FALSE(func->login_ui_shown());
1024 EXPECT_TRUE(func->scope_ui_shown());
1030 scoped_refptr<FakeGetAuthTokenFunction> func(new FakeGetAuthTokenFunction());
1031 func->set_extension(CreateExtension(CLIENT_ID | SCOPES));
1032 func->set_mint_token_result(TestOAuth2MintTokenFlow::ISSUE_ADVICE_SUCCESS);
1033 func->set_scope_ui_failure(GaiaWebAuthFlow::LOAD_FAILED);
1035 func.get(), "[{\"interactive\": true}]", browser());
1037 EXPECT_FALSE(func->login_ui_shown());
1038 EXPECT_TRUE(func->scope_ui_shown());
1044 scoped_refptr<FakeGetAuthTokenFunction> func(new FakeGetAuthTokenFunction());
1045 func->set_extension(CreateExtension(CLIENT_ID | SCOPES));
1046 func->set_mint_token_result(TestOAuth2MintTokenFlow::ISSUE_ADVICE_SUCCESS);
1047 func->set_scope_ui_failure(GaiaWebAuthFlow::INVALID_REDIRECT);
1049 func.get(), "[{\"interactive\": true}]", browser());
1051 EXPECT_FALSE(func->login_ui_shown());
1052 EXPECT_TRUE(func->scope_ui_shown());
1058 scoped_refptr<FakeGetAuthTokenFunction> func(new FakeGetAuthTokenFunction());
1059 func->set_extension(CreateExtension(CLIENT_ID | SCOPES));
1060 func->set_mint_token_result(TestOAuth2MintTokenFlow::ISSUE_ADVICE_SUCCESS);
1061 func->set_scope_ui_failure(GaiaWebAuthFlow::SERVICE_AUTH_ERROR);
1063 func.get(), "[{\"interactive\": true}]", browser());
1065 EXPECT_FALSE(func->login_ui_shown());
1066 EXPECT_TRUE(func->scope_ui_shown());
1084 scoped_refptr<FakeGetAuthTokenFunction> func(
1086 func->set_extension(extension.get());
1090 func->set_mint_token_result(TestOAuth2MintTokenFlow::ISSUE_ADVICE_SUCCESS);
1091 func->set_scope_ui_oauth_error(it->first);
1093 func.get(), "[{\"interactive\": true}]", browser());
1095 EXPECT_FALSE(func->login_ui_shown());
1096 EXPECT_TRUE(func->scope_ui_shown());
1104 scoped_refptr<FakeGetAuthTokenFunction> func(new FakeGetAuthTokenFunction());
1105 func->set_extension(extension.get());
1106 func->set_mint_token_result(TestOAuth2MintTokenFlow::ISSUE_ADVICE_SUCCESS);
1109 func.get(), "[{\"interactive\": true}]", browser()));
1113 EXPECT_FALSE(func->login_ui_shown());
1114 EXPECT_TRUE(func->scope_ui_shown());
1123 scoped_refptr<FakeGetAuthTokenFunction> func(new FakeGetAuthTokenFunction());
1124 func->set_extension(extension.get());
1136 RunFunctionAsync(func.get(), "[{}]");
1138 testing::Mock::VerifyAndClearExpectations(func.get());
1141 func->set_mint_token_result(TestOAuth2MintTokenFlow::MINT_TOKEN_SUCCESS);
1145 scoped_ptr<base::Value> value(WaitForSingleResult(func.get()));
1149 EXPECT_FALSE(func->login_ui_shown());
1150 EXPECT_FALSE(func->scope_ui_shown());
1156 scoped_refptr<FakeGetAuthTokenFunction> func(new FakeGetAuthTokenFunction());
1157 func->set_extension(extension.get());
1169 func->set_mint_token_result(TestOAuth2MintTokenFlow::ISSUE_ADVICE_SUCCESS);
1170 RunFunctionAsync(func.get(), "[{\"interactive\": true}]");
1172 testing::Mock::VerifyAndClearExpectations(func.get());
1173 EXPECT_FALSE(func->scope_ui_shown());
1179 scoped_ptr<base::Value> value(WaitForSingleResult(func.get()));
1183 EXPECT_FALSE(func->login_ui_shown());
1184 EXPECT_TRUE(func->scope_ui_shown());
1190 scoped_refptr<FakeGetAuthTokenFunction> func(new FakeGetAuthTokenFunction());
1191 func->set_extension(extension.get());
1203 func->set_mint_token_result(TestOAuth2MintTokenFlow::ISSUE_ADVICE_SUCCESS);
1204 RunFunctionAsync(func.get(), "[{\"interactive\": true}]");
1206 testing::Mock::VerifyAndClearExpectations(func.get());
1207 EXPECT_FALSE(func->scope_ui_shown());
1210 func->OnShutdown();
1211 EXPECT_EQ(std::string(errors::kCanceled), WaitForError(func.get()));
1212 EXPECT_FALSE(func->login_ui_shown());
1213 EXPECT_FALSE(func->scope_ui_shown());
1221 scoped_refptr<FakeGetAuthTokenFunction> func(new FakeGetAuthTokenFunction());
1222 func->set_extension(extension.get());
1226 func->set_mint_token_flow(flow.PassAs<OAuth2MintTokenFlow>());
1227 RunFunctionAsync(func.get(), "[{\"interactive\": false}]");
1230 func->OnShutdown();
1231 EXPECT_EQ(std::string(errors::kCanceled), WaitForError(func.get()));
1238 scoped_refptr<FakeGetAuthTokenFunction> func(new FakeGetAuthTokenFunction());
1239 func->set_extension(extension.get());
1252 func.get(), "[{}]", browser());
1254 EXPECT_FALSE(func->login_ui_shown());
1255 EXPECT_FALSE(func->scope_ui_shown());
1264 scoped_refptr<FakeGetAuthTokenFunction> func(new FakeGetAuthTokenFunction());
1265 func->set_extension(extension.get());
1274 func.get(), "[{}]", browser()));
1278 EXPECT_FALSE(func->login_ui_shown());
1279 EXPECT_FALSE(func->scope_ui_shown());
1286 scoped_refptr<FakeGetAuthTokenFunction> func(new FakeGetAuthTokenFunction());
1287 func->set_extension(extension.get());
1296 func.get(), "[{}]", browser());
1298 EXPECT_FALSE(func->login_ui_shown());
1299 EXPECT_FALSE(func->scope_ui_shown());
1306 scoped_refptr<FakeGetAuthTokenFunction> func(new FakeGetAuthTokenFunction());
1307 func->set_extension(extension.get());
1319 func->set_mint_token_result(TestOAuth2MintTokenFlow::ISSUE_ADVICE_SUCCESS);
1320 RunFunctionAsync(func.get(), "[{\"interactive\": true}]");
1332 scoped_ptr<base::Value> value(WaitForSingleResult(func.get()));
1336 EXPECT_FALSE(func->login_ui_shown());
1337 EXPECT_FALSE(func->scope_ui_shown());
1342 scoped_refptr<FakeGetAuthTokenFunction> func(new FakeGetAuthTokenFunction());
1344 func->set_extension(extension.get());
1353 func->set_login_ui_result(true);
1354 func->set_mint_token_result(TestOAuth2MintTokenFlow::ISSUE_ADVICE_SUCCESS);
1357 func.get(), "[{\"interactive\": true}]", browser()));
1361 EXPECT_TRUE(func->login_ui_shown());
1362 EXPECT_TRUE(func->scope_ui_shown());
1368 scoped_refptr<FakeGetAuthTokenFunction> func(new FakeGetAuthTokenFunction());
1371 func->set_extension(extension.get());
1374 EXPECT_FALSE(func->GetOAuth2ClientId().empty());
1375 EXPECT_NE("client1", func->GetOAuth2ClientId());
1379 scoped_refptr<FakeGetAuthTokenFunction> func(new FakeGetAuthTokenFunction());
1382 func->set_extension(extension.get());
1383 EXPECT_EQ("client1", func->GetOAuth2ClientId());
1391 scoped_refptr<FakeGetAuthTokenFunction> func(new FakeGetAuthTokenFunction());
1393 func->set_extension(extension.get());
1394 func->set_auto_login_access_token(false);
1395 func->set_mint_token_result(TestOAuth2MintTokenFlow::MINT_TOKEN_SUCCESS);
1397 RunFunctionAsync(func.get(), "[{}]");
1401 scoped_ptr<base::Value> value(WaitForSingleResult(func.get()));
1407 EXPECT_EQ("access_token-primary@example.com", func->login_access_token());
1416 scoped_refptr<FakeGetAuthTokenFunction> func(new FakeGetAuthTokenFunction());
1418 func->set_extension(extension.get());
1419 func->set_auto_login_access_token(false);
1420 func->set_mint_token_result(TestOAuth2MintTokenFlow::MINT_TOKEN_SUCCESS);
1422 RunFunctionAsync(func.get(), "[{\"account\": { \"id\": \"1\" } }]");
1426 scoped_ptr<base::Value> value(WaitForSingleResult(func.get()));
1432 EXPECT_EQ("access_token-primary@example.com", func->login_access_token());
1441 scoped_refptr<FakeGetAuthTokenFunction> func(new FakeGetAuthTokenFunction());
1443 func->set_extension(extension.get());
1444 func->set_auto_login_access_token(false);
1445 func->set_mint_token_result(TestOAuth2MintTokenFlow::MINT_TOKEN_SUCCESS);
1447 RunFunctionAsync(func.get(), "[{\"account\": { \"id\": \"2\" } }]");
1451 scoped_ptr<base::Value> value(WaitForSingleResult(func.get()));
1457 EXPECT_EQ("access_token-secondary@example.com", func->login_access_token());
1466 scoped_refptr<FakeGetAuthTokenFunction> func(new FakeGetAuthTokenFunction());
1468 func->set_extension(extension.get());
1469 func->set_auto_login_access_token(false);
1472 func.get(), "[{\"account\": { \"id\": \"3\" } }]", browser());
1483 scoped_refptr<FakeGetAuthTokenFunction> func(new FakeGetAuthTokenFunction());
1484 func->set_extension(CreateExtension(CLIENT_ID | SCOPES));
1485 func->set_mint_token_result(TestOAuth2MintTokenFlow::MINT_TOKEN_FAILURE);
1487 func.get(), "[{\"account\": { \"id\": \"2\" } }]", browser());
1489 EXPECT_FALSE(func->login_ui_shown());
1490 EXPECT_FALSE(func->scope_ui_shown());
1500 scoped_refptr<FakeGetAuthTokenFunction> func(new FakeGetAuthTokenFunction());
1501 func->set_extension(CreateExtension(CLIENT_ID | SCOPES));
1502 func->set_login_access_token_result(false);
1504 func.get(), "[{\"account\": { \"id\": \"2\" } }]", browser());
1515 scoped_refptr<FakeGetAuthTokenFunction> func(new FakeGetAuthTokenFunction());
1516 func->set_extension(CreateExtension(CLIENT_ID | SCOPES));
1517 func->set_mint_token_result(TestOAuth2MintTokenFlow::ISSUE_ADVICE_SUCCESS);
1518 func->set_scope_ui_failure(GaiaWebAuthFlow::WINDOW_CLOSED);
1520 func.get(),
1524 EXPECT_FALSE(func->login_ui_shown());
1525 EXPECT_TRUE(func->scope_ui_shown());
1530 scoped_refptr<FakeGetAuthTokenFunction> func(new FakeGetAuthTokenFunction());
1532 func->set_extension(extension.get());
1533 func->set_mint_token_result(TestOAuth2MintTokenFlow::MINT_TOKEN_SUCCESS);
1535 utils::RunFunctionAndReturnSingleResult(func.get(), "[{}]", browser()));
1540 const ExtensionTokenKey* token_key = func->GetExtensionTokenKeyForTest();
1547 scoped_refptr<FakeGetAuthTokenFunction> func(new FakeGetAuthTokenFunction());
1549 func->set_extension(extension.get());
1552 func.get(), "[{\"scopes\": []}]", browser()));
1559 scoped_refptr<FakeGetAuthTokenFunction> func(new FakeGetAuthTokenFunction());
1561 func->set_extension(extension.get());
1562 func->set_mint_token_result(TestOAuth2MintTokenFlow::MINT_TOKEN_SUCCESS);
1564 func.get(), "[{\"scopes\": [\"email\"]}]", browser()));
1569 const ExtensionTokenKey* token_key = func->GetExtensionTokenKeyForTest();
1576 scoped_refptr<FakeGetAuthTokenFunction> func(new FakeGetAuthTokenFunction());
1578 func->set_extension(extension.get());
1579 func->set_mint_token_result(TestOAuth2MintTokenFlow::MINT_TOKEN_SUCCESS);
1581 func.get(), "[{\"scopes\": [\"email\", \"foo\", \"bar\"]}]", browser()));
1586 const ExtensionTokenKey* token_key = func->GetExtensionTokenKeyForTest();
1596 scoped_refptr<IdentityRemoveCachedAuthTokenFunction> func(
1598 func->set_extension(test_util::CreateEmptyExtension(kExtensionId).get());
1600 func.get(),