Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(642)

Unified Diff: mojo/shell/public/cpp/application_test_base.h

Issue 1770533002: Change userid from a uint32_t to a string guid (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@33connector
Patch Set: . Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/shell/identity.cc ('k') | mojo/shell/public/cpp/connection.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/shell/public/cpp/application_test_base.h
diff --git a/mojo/shell/public/cpp/application_test_base.h b/mojo/shell/public/cpp/application_test_base.h
index 91160df0fbb65944aab5f29e12d62ebcbfa57ef2..958c7795f270d67a55bc46de935f24816f4fbde0 100644
--- a/mojo/shell/public/cpp/application_test_base.h
+++ b/mojo/shell/public/cpp/application_test_base.h
@@ -34,9 +34,9 @@ class TestHelper {
~TestHelper();
Connector* connector() { return shell_connection_->connector(); }
- std::string test_name() { return name_; }
+ const std::string& test_name() { return name_; }
+ const std::string& test_userid() { return userid_; }
uint32_t test_instance_id() { return instance_id_; }
- uint32_t test_userid() { return userid_; }
private:
// The application delegate used if GetShellClient is not overridden.
@@ -46,8 +46,8 @@ class TestHelper {
scoped_ptr<ShellConnection> shell_connection_;
std::string name_;
+ std::string userid_;
uint32_t instance_id_;
- uint32_t userid_;
DISALLOW_COPY_AND_ASSIGN(TestHelper);
};
@@ -62,17 +62,16 @@ class ApplicationTestBase : public testing::Test {
Connector* connector() {
return test_helper_ ? test_helper_->connector() : nullptr;
}
- std::string test_name() const {
- return test_helper_ ? test_helper_->test_name() : std::string();
+ const std::string& test_name() const {
+ return test_helper_ ? test_helper_->test_name() : empty_;
+ }
+ const std::string& test_userid() const {
+ return test_helper_ ? test_helper_->test_userid() : inherit_user_id_;
}
uint32_t test_instance_id() const {
return test_helper_ ? test_helper_->test_instance_id() :
shell::mojom::Connector::kInvalidApplicationID;
}
- uint32_t test_userid() const {
- return test_helper_ ? test_helper_->test_userid() :
- shell::mojom::Connector::kUserInherit;
- }
// Get the ShellClient for the application to be tested.
virtual ShellClient* GetShellClient();
@@ -88,6 +87,8 @@ class ApplicationTestBase : public testing::Test {
private:
scoped_ptr<TestHelper> test_helper_;
+ std::string empty_;
+ std::string inherit_user_id_ = shell::mojom::kInheritUserID;
DISALLOW_COPY_AND_ASSIGN(ApplicationTestBase);
};
« no previous file with comments | « mojo/shell/identity.cc ('k') | mojo/shell/public/cpp/connection.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698