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

Unified Diff: chrome/common/extensions/manifest_tests/extension_manifests_default_locale_unittest.cc

Issue 12025010: Move default_locale out of Extension class (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 11 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
Index: chrome/common/extensions/manifest_tests/extension_manifests_default_locale_unittest.cc
diff --git a/chrome/common/extensions/manifest_tests/extension_manifests_default_locale_unittest.cc b/chrome/common/extensions/manifest_tests/extension_manifests_default_locale_unittest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..5c872cab6549662c76e9829898e46f0f47d13a8d
--- /dev/null
+++ b/chrome/common/extensions/manifest_tests/extension_manifests_default_locale_unittest.cc
@@ -0,0 +1,26 @@
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
Devlin 2013/01/18 21:08:46 This file should be with the handler. To keep with
Joe Thomas 2013/01/18 22:16:57 Done.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/common/extensions/api/i18n/default_locale_handler.h"
+#include "chrome/common/extensions/extension_manifest_constants.h"
+#include "chrome/common/extensions/manifest_handler.h"
+#include "chrome/common/extensions/manifest_tests/extension_manifest_test.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+class DefaultLocaleManifestTest : public ExtensionManifestTest {
+ virtual void SetUp() OVERRIDE {
+ ExtensionManifestTest::SetUp();
+ extensions::ManifestHandler::Register(keys::kDefaultLocale,
Devlin 2013/01/18 21:08:46 This whole file should probably be in the extensio
Joe Thomas 2013/01/18 22:16:57 Done.
+ new extensions::DefaultLocaleHandler);
+ }
+};
+
+TEST_F(DefaultLocaleManifestTest, DefaultLocale) {
+ LoadAndExpectError("default_locale_invalid.json",
+ errors::kInvalidDefaultLocale);
+
+ scoped_refptr<extensions::Extension> extension(
+ LoadAndExpectSuccess("default_locale_valid.json"));
+ EXPECT_EQ("de-AT", extensions::LocaleInfo::GetDefaultLocale(extension));
+}

Powered by Google App Engine
This is Rietveld 408576698