Commit b8d49977 authored by rbpotter's avatar rbpotter Committed by Commit Bot

PrintPreviewHandler: Clean up unit test

Use ScopedRestoreDefaultLocale and correct variable name style.

Bug: 819806
Change-Id: I51436ceba079c411c051c602bbf9a1d90b3bfc32
Reviewed-on: https://chromium-review.googlesource.com/963749Reviewed-by: default avatarLei Zhang <thestig@chromium.org>
Commit-Queue: Rebekah Potter <rbpotter@chromium.org>
Cr-Commit-Position: refs/heads/master@{#543471}
parent c1decfff
...@@ -6,11 +6,11 @@ ...@@ -6,11 +6,11 @@
#include "base/base64.h" #include "base/base64.h"
#include "base/containers/flat_set.h" #include "base/containers/flat_set.h"
#include "base/i18n/rtl.h"
#include "base/json/json_writer.h" #include "base/json/json_writer.h"
#include "base/memory/ref_counted_memory.h" #include "base/memory/ref_counted_memory.h"
#include "base/strings/string16.h" #include "base/strings/string16.h"
#include "base/strings/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
#include "base/test/icu_test_util.h"
#include "base/values.h" #include "base/values.h"
#include "chrome/browser/printing/print_view_manager.h" #include "chrome/browser/printing/print_view_manager.h"
#include "chrome/browser/ui/webui/print_preview/print_preview_ui.h" #include "chrome/browser/ui/webui/print_preview/print_preview_ui.h"
...@@ -342,7 +342,7 @@ class PrintPreviewHandlerTest : public testing::Test { ...@@ -342,7 +342,7 @@ class PrintPreviewHandlerTest : public testing::Test {
void Initialize() { void Initialize() {
// Set locale since the delimeters we check in VerifyInitialSettings() // Set locale since the delimeters we check in VerifyInitialSettings()
// depend on it. // depend on it.
base::i18n::SetICUDefaultLocale("en"); base::test::ScopedRestoreICUDefaultLocale scoped_locale("en");
// Sending this message will enable javascript, so it must always be called // Sending this message will enable javascript, so it must always be called
// before any other messages are sent. // before any other messages are sent.
...@@ -394,14 +394,14 @@ class PrintPreviewHandlerTest : public testing::Test { ...@@ -394,14 +394,14 @@ class PrintPreviewHandlerTest : public testing::Test {
ASSERT_TRUE(settings->FindKeyOfType("isInAppKioskMode", ASSERT_TRUE(settings->FindKeyOfType("isInAppKioskMode",
base::Value::Type::BOOLEAN)); base::Value::Type::BOOLEAN));
const base::Value* thousandsDelimeter = settings->FindKeyOfType( const base::Value* thousands_delimeter = settings->FindKeyOfType(
"thousandsDelimeter", base::Value::Type::STRING); "thousandsDelimeter", base::Value::Type::STRING);
ASSERT_TRUE(thousandsDelimeter); ASSERT_TRUE(thousands_delimeter);
EXPECT_EQ(",", thousandsDelimeter->GetString()); EXPECT_EQ(",", thousands_delimeter->GetString());
const base::Value* decimalDelimeter = const base::Value* decimal_delimeter =
settings->FindKeyOfType("decimalDelimeter", base::Value::Type::STRING); settings->FindKeyOfType("decimalDelimeter", base::Value::Type::STRING);
ASSERT_TRUE(decimalDelimeter); ASSERT_TRUE(decimal_delimeter);
EXPECT_EQ(".", decimalDelimeter->GetString()); EXPECT_EQ(".", decimal_delimeter->GetString());
ASSERT_TRUE( ASSERT_TRUE(
settings->FindKeyOfType("unitType", base::Value::Type::INTEGER)); settings->FindKeyOfType("unitType", base::Value::Type::INTEGER));
......
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