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

Unified Diff: chrome/browser/extensions/api/enterprise_platform_keys/enterprise_platform_keys_apitest_nss.cc

Issue 428223003: More platformKeys api tests for the new system token. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed comments. Created 6 years, 5 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 | « no previous file | chrome/test/data/extensions/api_test/enterprise_platform_keys.crx » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/enterprise_platform_keys/enterprise_platform_keys_apitest_nss.cc
diff --git a/chrome/browser/extensions/api/enterprise_platform_keys/enterprise_platform_keys_apitest_nss.cc b/chrome/browser/extensions/api/enterprise_platform_keys/enterprise_platform_keys_apitest_nss.cc
index be09c003785c2dd76abee2e15601430e827397a8..a039e88d196ddd850dfbbe9b8ccc578a7744edb3 100644
--- a/chrome/browser/extensions/api/enterprise_platform_keys/enterprise_platform_keys_apitest_nss.cc
+++ b/chrome/browser/extensions/api/enterprise_platform_keys/enterprise_platform_keys_apitest_nss.cc
@@ -185,32 +185,30 @@ class EnterprisePlatformKeysTest : public ExtensionApiTest {
loop.Run();
}
- {
- base::RunLoop loop;
- content::BrowserThread::PostTask(
- content::BrowserThread::IO,
- FROM_HERE,
- base::Bind(&EnterprisePlatformKeysTest::SetUpTestSystemSlot,
- base::Unretained(this),
- browser()->profile()->GetResourceContext(),
- loop.QuitClosure()));
- loop.Run();
- }
-
SetPolicy();
}
- virtual void TearDownOnMainThread() OVERRIDE {
+ void SetUpTestSystemSlot() {
base::RunLoop loop;
content::BrowserThread::PostTask(
content::BrowserThread::IO,
FROM_HERE,
- base::Bind(&EnterprisePlatformKeysTest::TearDownTestSystemSlot,
+ base::Bind(&EnterprisePlatformKeysTest::SetUpTestSystemSlotOnIO,
base::Unretained(this),
+ browser()->profile()->GetResourceContext(),
loop.QuitClosure()));
loop.Run();
+ }
- ExtensionApiTest::TearDownOnMainThread();
+ void TearDownTestSystemSlot() {
+ base::RunLoop loop;
+ content::BrowserThread::PostTask(
+ content::BrowserThread::IO,
+ FROM_HERE,
+ base::Bind(&EnterprisePlatformKeysTest::TearDownTestSystemSlotOnIO,
+ base::Unretained(this),
+ loop.QuitClosure()));
+ loop.Run();
}
private:
@@ -226,7 +224,7 @@ class EnterprisePlatformKeysTest : public ExtensionApiTest {
done_callback.Run();
}
- void SetUpTestSystemSlot(content::ResourceContext* context,
+ void SetUpTestSystemSlotOnIO(content::ResourceContext* context,
const base::Closure& done_callback) {
test_system_slot_.reset(new crypto::ScopedTestSystemNSSKeySlot());
ASSERT_TRUE(test_system_slot_->ConstructedSuccessfully());
@@ -241,7 +239,7 @@ class EnterprisePlatformKeysTest : public ExtensionApiTest {
content::BrowserThread::UI, FROM_HERE, done_callback);
}
- void TearDownTestSystemSlot(const base::Closure& done_callback) {
+ void TearDownTestSystemSlotOnIO(const base::Closure& done_callback) {
test_system_slot_.reset();
content::BrowserThread::PostTask(
@@ -284,7 +282,17 @@ class EnterprisePlatformKeysTest : public ExtensionApiTest {
} // namespace
-IN_PROC_BROWSER_TEST_F(EnterprisePlatformKeysTest, Basic) {
+IN_PROC_BROWSER_TEST_F(EnterprisePlatformKeysTest, SystemTokenEnabled) {
+ SetUpTestSystemSlot();
+ ASSERT_TRUE(RunExtensionSubtest(
+ "",
+ base::StringPrintf("chrome-extension://%s/basic.html?systemTokenEnabled",
+ kTestExtensionID)))
+ << message_;
+ TearDownTestSystemSlot();
+}
+
+IN_PROC_BROWSER_TEST_F(EnterprisePlatformKeysTest, SystemTokenDisabled) {
ASSERT_TRUE(RunExtensionSubtest(
"",
base::StringPrintf("chrome-extension://%s/basic.html", kTestExtensionID)))
« no previous file with comments | « no previous file | chrome/test/data/extensions/api_test/enterprise_platform_keys.crx » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698