Commit 5f9860d6 authored by Jeroen Dhollander's avatar Jeroen Dhollander Committed by Commit Bot

Words matter. Replace offensive words.

See go/inclusive-codebase.

The following words were replaced:
  - blacklist
  - whitelist
  - dummy
  - sanity-check
  - he/she/her/him/her

The following words were searched for but not found:
  - slave
  - master (Note: still used as branch name for
	  chromeos/assistant/internal, which I'll
	  look at in another commit).
  - first-class
  - sane/crazy/insane/cripple
  - greylist/darklist/lightlist
  - grandfathered
  - (black|white|gray|grey) hat
  - redline
  - man-in-the-middle
  - white glove
  - white label

     Tests: compiled

Bug: b/161801556
Change-Id: I37d96697e38ee171f6df7171061a9ecc075eeca1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2310846Reviewed-by: default avatarXiaohui Chen <xiaohuic@chromium.org>
Commit-Queue: Jeroen Dhollander <jeroendh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#790852}
parent 86d988bf
......@@ -39,7 +39,7 @@ class MockedAssistantInteraction {
TestAssistantService* service_;
std::unique_ptr<InteractionResponse> response_;
std::string query_ = "<dummy-query>";
std::string query_ = "<fake-query>";
Resolution resolution_ = Resolution::kNormal;
};
......
......@@ -9,7 +9,7 @@
namespace ash {
// Dummy implementation of the Assistant client.
// Fake implementation of the Assistant client.
class TestAssistantClient : public AssistantClient {
public:
TestAssistantClient();
......
......@@ -25,10 +25,10 @@ using chromeos::assistant::AssistantSuggestion;
// - A conversation is finished before starting a new one.
// - No responses (text, card, ...) are sent before starting or after
// finishing an interaction.
class SanityCheckSubscriber : public AssistantInteractionSubscriber {
class LibassistantContractChecker : public AssistantInteractionSubscriber {
public:
SanityCheckSubscriber() = default;
~SanityCheckSubscriber() override = default;
LibassistantContractChecker() = default;
~LibassistantContractChecker() override = default;
// DefaultAssistantInteractionSubscriber implementation:
void OnInteractionStarted(
......@@ -89,7 +89,7 @@ class SanityCheckSubscriber : public AssistantInteractionSubscriber {
ConversationState current_state_ = ConversationState::kNotStarted;
DISALLOW_COPY_AND_ASSIGN(SanityCheckSubscriber);
DISALLOW_COPY_AND_ASSIGN(LibassistantContractChecker);
};
// Subscriber that tracks the current interaction.
......@@ -187,10 +187,11 @@ class ResolutionResponse : public InteractionResponse::Response {
};
TestAssistantService::TestAssistantService()
: sanity_check_subscriber_(std::make_unique<SanityCheckSubscriber>()),
: libassistant_contract_checker_(
std::make_unique<LibassistantContractChecker>()),
current_interaction_subscriber_(
std::make_unique<CurrentInteractionSubscriber>()) {
AddAssistantInteractionSubscriber(sanity_check_subscriber_.get());
AddAssistantInteractionSubscriber(libassistant_contract_checker_.get());
AddAssistantInteractionSubscriber(current_interaction_subscriber_.get());
}
......@@ -270,8 +271,7 @@ void TestAssistantService::NotifyEntryIntoAssistantUi(
chromeos::assistant::AssistantEntryPoint entry_point) {}
void TestAssistantService::AddTimeToTimer(const std::string& id,
base::TimeDelta duration) {
}
base::TimeDelta duration) {}
void TestAssistantService::PauseTimer(const std::string& id) {}
......
......@@ -18,7 +18,7 @@
namespace ash {
class CurrentInteractionSubscriber;
class SanityCheckSubscriber;
class LibassistantContractChecker;
// A response issued when an Assistant interaction is started.
// Used both for text and voice interactions. To build a response, simply
......@@ -55,7 +55,7 @@ class InteractionResponse {
DISALLOW_COPY_AND_ASSIGN(InteractionResponse);
};
// Dummy implementation of the Assistant service.
// Fake implementation of the Assistant service.
// It behaves as if the Assistant service is up-and-running,
// and will inform the |AssistantInteractionSubscriber| instances when
// interactions start/stop.
......@@ -117,7 +117,7 @@ class TestAssistantService : public chromeos::assistant::Assistant {
const std::string& query = std::string());
void SendInteractionResponse();
std::unique_ptr<SanityCheckSubscriber> sanity_check_subscriber_;
std::unique_ptr<LibassistantContractChecker> libassistant_contract_checker_;
std::unique_ptr<CurrentInteractionSubscriber> current_interaction_subscriber_;
std::unique_ptr<InteractionResponse> interaction_response_;
......
......@@ -31,47 +31,46 @@ namespace chromeos {
namespace assistant {
////////////////////////////////////////////////////////////////////////////////
// DummyAuthProvider
// FakeAuthProvider
////////////////////////////////////////////////////////////////////////////////
std::string PlatformApiImpl::DummyAuthProvider::GetAuthClientId() {
std::string PlatformApiImpl::FakeAuthProvider::GetAuthClientId() {
return "kFakeClientId";
}
std::vector<std::string>
PlatformApiImpl::DummyAuthProvider::GetClientCertificateChain() {
PlatformApiImpl::FakeAuthProvider::GetClientCertificateChain() {
return {};
}
void PlatformApiImpl::DummyAuthProvider::CreateCredentialAttestationJwt(
void PlatformApiImpl::FakeAuthProvider::CreateCredentialAttestationJwt(
const std::string& authorization_code,
const std::vector<std::pair<std::string, std::string>>& claims,
CredentialCallback attestation_callback) {
attestation_callback(Error::SUCCESS, "", "");
}
void PlatformApiImpl::DummyAuthProvider::CreateRefreshAssertionJwt(
void PlatformApiImpl::FakeAuthProvider::CreateRefreshAssertionJwt(
const std::string& key_identifier,
const std::vector<std::pair<std::string, std::string>>& claims,
AssertionCallback assertion_callback) {
assertion_callback(Error::SUCCESS, "");
}
void PlatformApiImpl::DummyAuthProvider::CreateDeviceAttestationJwt(
void PlatformApiImpl::FakeAuthProvider::CreateDeviceAttestationJwt(
const std::vector<std::pair<std::string, std::string>>& claims,
AssertionCallback attestation_callback) {
attestation_callback(Error::SUCCESS, "");
}
std::string
PlatformApiImpl::DummyAuthProvider::GetAttestationCertFingerprint() {
std::string PlatformApiImpl::FakeAuthProvider::GetAttestationCertFingerprint() {
return "kFakeAttestationCertFingerprint";
}
void PlatformApiImpl::DummyAuthProvider::RemoveCredentialKey(
void PlatformApiImpl::FakeAuthProvider::RemoveCredentialKey(
const std::string& key_identifier) {}
void PlatformApiImpl::DummyAuthProvider::Reset() {}
void PlatformApiImpl::FakeAuthProvider::Reset() {}
////////////////////////////////////////////////////////////////////////////////
// PlatformApiImpl
......
......@@ -66,10 +66,10 @@ class PlatformApiImpl : public CrosPlatformApi,
private:
// ChromeOS does not use auth manager, so we don't yet need to implement a
// real auth provider.
class DummyAuthProvider : public assistant_client::AuthProvider {
class FakeAuthProvider : public assistant_client::AuthProvider {
public:
DummyAuthProvider() = default;
~DummyAuthProvider() override = default;
FakeAuthProvider() = default;
~FakeAuthProvider() override = default;
// assistant_client::AuthProvider overrides
std::string GetAuthClientId() override;
......@@ -98,7 +98,7 @@ class PlatformApiImpl : public CrosPlatformApi,
AudioInputProviderImpl audio_input_provider_;
AudioOutputProviderImpl audio_output_provider_;
DummyAuthProvider auth_provider_;
FakeAuthProvider auth_provider_;
FileProviderImpl file_provider_;
NetworkProviderImpl network_provider_;
std::unique_ptr<SystemProviderImpl> system_provider_;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment