| Index: chrome/renderer/autofill/form_autofill_browsertest.cc
 | 
| diff --git a/chrome/renderer/autofill/form_autofill_browsertest.cc b/chrome/renderer/autofill/form_autofill_browsertest.cc
 | 
| index 15ab038e008ff14f34d95cb372bc77cfbc03830e..93d572b0640ccf2bdf103c08c30f94d2ea9e7ca6 100644
 | 
| --- a/chrome/renderer/autofill/form_autofill_browsertest.cc
 | 
| +++ b/chrome/renderer/autofill/form_autofill_browsertest.cc
 | 
| @@ -53,7 +53,7 @@ class FormAutofillTest : public ChromeRenderViewTest {
 | 
|                      const std::vector<string16>& labels,
 | 
|                      const std::vector<string16>& names,
 | 
|                      const std::vector<string16>& values) {
 | 
| -    std::vector<string16> control_types(labels.size(), ASCIIToUTF16("text"));
 | 
| +    std::vector<std::string> control_types(labels.size(), "text");
 | 
|      ExpectLabelsAndTypes(html, labels, names, values, control_types);
 | 
|    }
 | 
|  
 | 
| @@ -61,7 +61,7 @@ class FormAutofillTest : public ChromeRenderViewTest {
 | 
|                              const std::vector<string16>& labels,
 | 
|                              const std::vector<string16>& names,
 | 
|                              const std::vector<string16>& values,
 | 
| -                            const std::vector<string16>& control_types) {
 | 
| +                            const std::vector<std::string>& control_types) {
 | 
|      ASSERT_EQ(labels.size(), names.size());
 | 
|      ASSERT_EQ(labels.size(), values.size());
 | 
|      ASSERT_EQ(labels.size(), control_types.size());
 | 
| @@ -84,7 +84,7 @@ class FormAutofillTest : public ChromeRenderViewTest {
 | 
|      const std::vector<FormFieldData>& fields = form.fields;
 | 
|      ASSERT_EQ(labels.size(), fields.size());
 | 
|      for (size_t i = 0; i < labels.size(); ++i) {
 | 
| -      int max_length = control_types[i] == ASCIIToUTF16("text") ?
 | 
| +      int max_length = control_types[i] == "text" ?
 | 
|                         WebInputElement::defaultMaxLength() : 0;
 | 
|        FormFieldData expected;
 | 
|        expected.label = labels[i];
 | 
| @@ -132,7 +132,7 @@ TEST_F(FormAutofillTest, WebFormControlElementToFormField) {
 | 
|    WebFormControlElementToFormField(element, autofill::EXTRACT_NONE, &result1);
 | 
|  
 | 
|    FormFieldData expected;
 | 
| -  expected.form_control_type = ASCIIToUTF16("text");
 | 
| +  expected.form_control_type = "text";
 | 
|    expected.max_length = WebInputElement::defaultMaxLength();
 | 
|  
 | 
|    expected.name = ASCIIToUTF16("element");
 | 
| @@ -163,7 +163,8 @@ TEST_F(FormAutofillTest, WebFormControlElementToFormFieldAutocompleteOff) {
 | 
|    FormFieldData expected;
 | 
|    expected.name = ASCIIToUTF16("element");
 | 
|    expected.value = ASCIIToUTF16("value");
 | 
| -  expected.form_control_type = ASCIIToUTF16("text");
 | 
| +  expected.form_control_type = "text";
 | 
| +  expected.autocomplete_attribute = "off";
 | 
|    expected.max_length = WebInputElement::defaultMaxLength();
 | 
|    EXPECT_FORM_FIELD_DATA_EQUALS(expected, result);
 | 
|  }
 | 
| @@ -184,7 +185,7 @@ TEST_F(FormAutofillTest, WebFormControlElementToFormFieldMaxLength) {
 | 
|    FormFieldData expected;
 | 
|    expected.name = ASCIIToUTF16("element");
 | 
|    expected.value = ASCIIToUTF16("value");
 | 
| -  expected.form_control_type = ASCIIToUTF16("text");
 | 
| +  expected.form_control_type = "text";
 | 
|    expected.max_length = 5;
 | 
|    EXPECT_FORM_FIELD_DATA_EQUALS(expected, result);
 | 
|  }
 | 
| @@ -205,7 +206,7 @@ TEST_F(FormAutofillTest, WebFormControlElementToFormFieldAutofilled) {
 | 
|    FormFieldData expected;
 | 
|    expected.name = ASCIIToUTF16("element");
 | 
|    expected.value = ASCIIToUTF16("value");
 | 
| -  expected.form_control_type = ASCIIToUTF16("text");
 | 
| +  expected.form_control_type = "text";
 | 
|    expected.max_length = WebInputElement::defaultMaxLength();
 | 
|    expected.is_autofilled = true;
 | 
|    EXPECT_FORM_FIELD_DATA_EQUALS(expected, result);
 | 
| @@ -229,7 +230,7 @@ TEST_F(FormAutofillTest, WebFormControlElementToFormFieldSelect) {
 | 
|    FormFieldData expected;
 | 
|    expected.name = ASCIIToUTF16("element");
 | 
|    expected.max_length = 0;
 | 
| -  expected.form_control_type = ASCIIToUTF16("select-one");
 | 
| +  expected.form_control_type = "select-one";
 | 
|  
 | 
|    expected.value = ASCIIToUTF16("CA");
 | 
|    EXPECT_FORM_FIELD_DATA_EQUALS(expected, result1);
 | 
| @@ -279,28 +280,28 @@ TEST_F(FormAutofillTest, WebFormControlElementToFormFieldInvalidType) {
 | 
|    expected.max_length = 0;
 | 
|  
 | 
|    expected.name = ASCIIToUTF16("hidden");
 | 
| -  expected.form_control_type = ASCIIToUTF16("hidden");
 | 
| +  expected.form_control_type = "hidden";
 | 
|    EXPECT_FORM_FIELD_DATA_EQUALS(expected, result);
 | 
|  
 | 
|    web_element = frame->document().getElementById("password");
 | 
|    element = web_element.to<WebFormControlElement>();
 | 
|    WebFormControlElementToFormField(element, autofill::EXTRACT_VALUE, &result);
 | 
|    expected.name = ASCIIToUTF16("password");
 | 
| -  expected.form_control_type = ASCIIToUTF16("password");
 | 
| +  expected.form_control_type = "password";
 | 
|    EXPECT_FORM_FIELD_DATA_EQUALS(expected, result);
 | 
|  
 | 
|    web_element = frame->document().getElementById("checkbox");
 | 
|    element = web_element.to<WebFormControlElement>();
 | 
|    WebFormControlElementToFormField(element, autofill::EXTRACT_VALUE, &result);
 | 
|    expected.name = ASCIIToUTF16("checkbox");
 | 
| -  expected.form_control_type = ASCIIToUTF16("checkbox");
 | 
| +  expected.form_control_type = "checkbox";
 | 
|    EXPECT_FORM_FIELD_DATA_EQUALS(expected, result);
 | 
|  
 | 
|    web_element = frame->document().getElementById("radio");
 | 
|    element = web_element.to<WebFormControlElement>();
 | 
|    WebFormControlElementToFormField(element, autofill::EXTRACT_VALUE, &result);
 | 
|    expected.name = ASCIIToUTF16("radio");
 | 
| -  expected.form_control_type = ASCIIToUTF16("radio");
 | 
| +  expected.form_control_type = "radio";
 | 
|    EXPECT_FORM_FIELD_DATA_EQUALS(expected, result);
 | 
|  
 | 
|  
 | 
| @@ -308,7 +309,7 @@ TEST_F(FormAutofillTest, WebFormControlElementToFormFieldInvalidType) {
 | 
|    element = web_element.to<WebFormControlElement>();
 | 
|    WebFormControlElementToFormField(element, autofill::EXTRACT_VALUE, &result);
 | 
|    expected.name = ASCIIToUTF16("submit");
 | 
| -  expected.form_control_type = ASCIIToUTF16("submit");
 | 
| +  expected.form_control_type = "submit";
 | 
|    EXPECT_FORM_FIELD_DATA_EQUALS(expected, result);
 | 
|  }
 | 
|  
 | 
| @@ -316,114 +317,72 @@ TEST_F(FormAutofillTest, WebFormControlElementToFormFieldInvalidType) {
 | 
|  TEST_F(FormAutofillTest, WebFormControlElementToFormFieldAutocompletetype) {
 | 
|    std::string html =
 | 
|        "<INPUT type=\"text\" id=\"absent\"/>"
 | 
| -      "<INPUT type=\"text\" id=\"empty\" x-autocompletetype=\"\"/>"
 | 
| -      "<INPUT type=\"text\" id=\"whitespace\" x-autocompletetype=\"  \"/>"
 | 
| -      "<INPUT type=\"text\" id=\"regular\" x-autocompletetype=\"email\"/>"
 | 
| +      "<INPUT type=\"text\" id=\"empty\" autocomplete=\"\"/>"
 | 
| +      "<INPUT type=\"text\" id=\"off\" autocomplete=\"off\"/>"
 | 
| +      "<INPUT type=\"text\" id=\"regular\" autocomplete=\"email\"/>"
 | 
|        "<INPUT type=\"text\" id=\"multi-valued\" "
 | 
| -      "       x-autocompletetype=\"x-confirm-email email\"/>"
 | 
| -      "<INPUT type=\"text\" id=\"unprefixed\" autocompletetype=\"email\"/>"
 | 
| -      "<SELECT id=\"select\" x-autocompletetype=\"state\"/>"
 | 
| +      "       autocomplete=\"billing email\"/>"
 | 
| +      "<INPUT type=\"text\" id=\"experimental\" x-autocompletetype=\"email\"/>"
 | 
| +      "<SELECT id=\"select\" autocomplete=\"state\"/>"
 | 
|        "  <OPTION value=\"CA\">California</OPTION>"
 | 
|        "  <OPTION value=\"TX\">Texas</OPTION>"
 | 
|        "</SELECT>";
 | 
|    html +=
 | 
| -      "<INPUT type=\"text\" id=\"malicious\" x-autocompletetype=\"" +
 | 
| +      "<INPUT type=\"text\" id=\"malicious\" autocomplete=\"" +
 | 
|        std::string(10000, 'x') + "\"/>";
 | 
|    LoadHTML(html.c_str());
 | 
|  
 | 
|    WebFrame* frame = GetMainFrame();
 | 
|    ASSERT_NE(static_cast<WebFrame*>(NULL), frame);
 | 
|  
 | 
| -  // An absent attribute is equivalent to an empty one.
 | 
| -  WebElement web_element = frame->document().getElementById("absent");
 | 
| -  WebFormControlElement element = web_element.to<WebFormControlElement>();
 | 
| -  FormFieldData result1;
 | 
| -  WebFormControlElementToFormField(element, autofill::EXTRACT_NONE, &result1);
 | 
| -
 | 
| -  FormFieldData expected;
 | 
| -  expected.name = ASCIIToUTF16("absent");
 | 
| -  expected.form_control_type = ASCIIToUTF16("text");
 | 
| -  expected.autocomplete_type = string16();
 | 
| -  expected.max_length = WebInputElement::defaultMaxLength();
 | 
| -  EXPECT_FORM_FIELD_DATA_EQUALS(expected, result1);
 | 
| -
 | 
| -  web_element = frame->document().getElementById("empty");
 | 
| -  element = web_element.to<WebFormControlElement>();
 | 
| -  FormFieldData result2;
 | 
| -  WebFormControlElementToFormField(element, autofill::EXTRACT_NONE, &result2);
 | 
| -  expected.name = ASCIIToUTF16("empty");
 | 
| -  expected.form_control_type = ASCIIToUTF16("text");
 | 
| -  expected.autocomplete_type = string16();
 | 
| -  expected.max_length = WebInputElement::defaultMaxLength();
 | 
| -  EXPECT_FORM_FIELD_DATA_EQUALS(expected, result2);
 | 
| -
 | 
| -  // The renderer should trim whitespace.
 | 
| -  web_element = frame->document().getElementById("whitespace");
 | 
| -  element = web_element.to<WebFormControlElement>();
 | 
| -  FormFieldData result3;
 | 
| -  WebFormControlElementToFormField(element, autofill::EXTRACT_NONE, &result3);
 | 
| -  expected.name = ASCIIToUTF16("whitespace");
 | 
| -  expected.form_control_type = ASCIIToUTF16("text");
 | 
| -  expected.autocomplete_type = string16();
 | 
| -  expected.max_length = WebInputElement::defaultMaxLength();
 | 
| -  EXPECT_FORM_FIELD_DATA_EQUALS(expected, result3);
 | 
| +  struct TestCase {
 | 
| +    const std::string element_id;
 | 
| +    const std::string form_control_type;
 | 
| +    const std::string autocomplete_attribute;
 | 
| +  };
 | 
| +  TestCase test_cases[] = {
 | 
| +    // An absent attribute is equivalent to an empty one.
 | 
| +    { "absent", "text", "" },
 | 
| +    // Make sure there are no issues parsing an empty attribute.
 | 
| +    { "empty", "text", "" },
 | 
| +    // Make sure there are no issues parsing an attribute value that isn't a
 | 
| +    // type hint.
 | 
| +    { "off", "text", "off" },
 | 
| +    // Common case: exactly one type specified.
 | 
| +    { "regular", "text", "email" },
 | 
| +    // Verify that we correctly extract multiple tokens as well.
 | 
| +    { "multi-valued", "text", "billing email" },
 | 
| +    // We previously extracted this data from the experimental
 | 
| +    // 'x-autocompletetype' attribute.  Now that the field type hints are part
 | 
| +    // of the spec under the autocomplete attribute, we no longer support the
 | 
| +    // experimental version.
 | 
| +    { "experimental", "text", "" },
 | 
| +    // <select> elements should behave no differently from text fields here.
 | 
| +    { "select", "select-one", "state" },
 | 
| +    // Very long attribute values should be replaced by a default string, to
 | 
| +    // prevent malicious websites from DOSing the browser process.
 | 
| +    { "malicious", "text", "x-max-data-length-exceeded" },
 | 
| +  };
 | 
| +
 | 
| +  for (size_t i = 0; i < ARRAYSIZE_UNSAFE(test_cases); ++i) {
 | 
| +    WebElement web_element = frame->document().getElementById(
 | 
| +        ASCIIToUTF16(test_cases[i].element_id));
 | 
| +    WebFormControlElement element = web_element.to<WebFormControlElement>();
 | 
| +    FormFieldData result;
 | 
| +    WebFormControlElementToFormField(element, autofill::EXTRACT_NONE, &result);
 | 
|  
 | 
| -  // Common case: exactly one type specified.
 | 
| -  web_element = frame->document().getElementById("regular");
 | 
| -  element = web_element.to<WebFormControlElement>();
 | 
| -  FormFieldData result4;
 | 
| -  WebFormControlElementToFormField(element, autofill::EXTRACT_NONE, &result4);
 | 
| -  expected.name = ASCIIToUTF16("regular");
 | 
| -  expected.form_control_type = ASCIIToUTF16("text");
 | 
| -  expected.autocomplete_type = ASCIIToUTF16("email");
 | 
| -  expected.max_length = WebInputElement::defaultMaxLength();
 | 
| -  EXPECT_FORM_FIELD_DATA_EQUALS(expected, result4);
 | 
| -
 | 
| -  // Verify that we correctly extract fallback types as well.
 | 
| -  web_element = frame->document().getElementById("multi-valued");
 | 
| -  element = web_element.to<WebFormControlElement>();
 | 
| -  FormFieldData result5;
 | 
| -  WebFormControlElementToFormField(element, autofill::EXTRACT_NONE, &result5);
 | 
| -  expected.name = ASCIIToUTF16("multi-valued");
 | 
| -  expected.form_control_type = ASCIIToUTF16("text");
 | 
| -  expected.autocomplete_type = ASCIIToUTF16("x-confirm-email email");
 | 
| -  expected.max_length = WebInputElement::defaultMaxLength();
 | 
| -  EXPECT_FORM_FIELD_DATA_EQUALS(expected, result5);
 | 
| -
 | 
| -  // The attribute is not yet part of the HTML standard, so we only recognize
 | 
| -  // the prefixed version -- 'x-autocompletetype' -- and not the unprefixed one.
 | 
| -  web_element = frame->document().getElementById("unprefixed");
 | 
| -  element = web_element.to<WebFormControlElement>();
 | 
| -  FormFieldData result6;
 | 
| -  WebFormControlElementToFormField(element, autofill::EXTRACT_NONE, &result6);
 | 
| -  expected.name = ASCIIToUTF16("unprefixed");
 | 
| -  expected.form_control_type = ASCIIToUTF16("text");
 | 
| -  expected.autocomplete_type = string16();
 | 
| -  expected.max_length = WebInputElement::defaultMaxLength();
 | 
| -  EXPECT_FORM_FIELD_DATA_EQUALS(expected, result6);
 | 
| -
 | 
| -  // <select> elements should behave no differently from text fields here.
 | 
| -  web_element = frame->document().getElementById("select");
 | 
| -  element = web_element.to<WebFormControlElement>();
 | 
| -  FormFieldData result7;
 | 
| -  WebFormControlElementToFormField(element, autofill::EXTRACT_NONE, &result7);
 | 
| -  expected.name = ASCIIToUTF16("select");
 | 
| -  expected.form_control_type = ASCIIToUTF16("select-one");
 | 
| -  expected.autocomplete_type = ASCIIToUTF16("state");
 | 
| -  expected.max_length = 0;
 | 
| -  EXPECT_FORM_FIELD_DATA_EQUALS(expected, result7);
 | 
| -
 | 
| -  // Very long attribute values should be replaced by a default string, to
 | 
| -  // prevent malicious websites from DOSing the browser process.
 | 
| -  web_element = frame->document().getElementById("malicious");
 | 
| -  element = web_element.to<WebFormControlElement>();
 | 
| -  FormFieldData result8;
 | 
| -  WebFormControlElementToFormField(element, autofill::EXTRACT_NONE, &result8);
 | 
| -  expected.name = ASCIIToUTF16("malicious");
 | 
| -  expected.form_control_type = ASCIIToUTF16("text");
 | 
| -  expected.autocomplete_type = ASCIIToUTF16("x-max-data-length-exceeded");
 | 
| -  expected.max_length = WebInputElement::defaultMaxLength();
 | 
| -  EXPECT_FORM_FIELD_DATA_EQUALS(expected, result8);
 | 
| +    FormFieldData expected;
 | 
| +    expected.name = ASCIIToUTF16(test_cases[i].element_id);
 | 
| +    expected.form_control_type = test_cases[i].form_control_type;
 | 
| +    expected.autocomplete_attribute = test_cases[i].autocomplete_attribute;
 | 
| +    if (test_cases[i].form_control_type == "text")
 | 
| +      expected.max_length = WebInputElement::defaultMaxLength();
 | 
| +    else
 | 
| +      expected.max_length = 0;
 | 
| +
 | 
| +    SCOPED_TRACE(test_cases[i].element_id);
 | 
| +    EXPECT_FORM_FIELD_DATA_EQUALS(expected, result);
 | 
| +  }
 | 
|  }
 | 
|  
 | 
|  TEST_F(FormAutofillTest, WebFormElementToFormData) {
 | 
| @@ -474,21 +433,21 @@ TEST_F(FormAutofillTest, WebFormElementToFormData) {
 | 
|    expected.name = ASCIIToUTF16("firstname");
 | 
|    expected.value = ASCIIToUTF16("John");
 | 
|    expected.label = ASCIIToUTF16("First name:");
 | 
| -  expected.form_control_type = ASCIIToUTF16("text");
 | 
| +  expected.form_control_type = "text";
 | 
|    expected.max_length = WebInputElement::defaultMaxLength();
 | 
|    EXPECT_FORM_FIELD_DATA_EQUALS(expected, fields[0]);
 | 
|  
 | 
|    expected.name = ASCIIToUTF16("lastname");
 | 
|    expected.value = ASCIIToUTF16("Smith");
 | 
|    expected.label = ASCIIToUTF16("Last name:");
 | 
| -  expected.form_control_type = ASCIIToUTF16("text");
 | 
| +  expected.form_control_type = "text";
 | 
|    expected.max_length = WebInputElement::defaultMaxLength();
 | 
|    EXPECT_FORM_FIELD_DATA_EQUALS(expected, fields[1]);
 | 
|  
 | 
|    expected.name = ASCIIToUTF16("state");
 | 
|    expected.value = ASCIIToUTF16("CA");
 | 
|    expected.label = ASCIIToUTF16("State:");
 | 
| -  expected.form_control_type = ASCIIToUTF16("select-one");
 | 
| +  expected.form_control_type = "select-one";
 | 
|    expected.max_length = 0;
 | 
|    EXPECT_FORM_FIELD_DATA_EQUALS(expected, fields[2]);
 | 
|  }
 | 
| @@ -565,7 +524,7 @@ TEST_F(FormAutofillTest, ExtractMultipleForms) {
 | 
|    ASSERT_EQ(3U, fields.size());
 | 
|  
 | 
|    FormFieldData expected;
 | 
| -  expected.form_control_type = ASCIIToUTF16("text");
 | 
| +  expected.form_control_type = "text";
 | 
|    expected.max_length = WebInputElement::defaultMaxLength();
 | 
|  
 | 
|    expected.name = ASCIIToUTF16("firstname");
 | 
| @@ -680,7 +639,7 @@ TEST_F(FormAutofillTest, WebFormElementToFormDataAutocomplete) {
 | 
|      ASSERT_EQ(3U, fields.size());
 | 
|  
 | 
|      FormFieldData expected;
 | 
| -    expected.form_control_type = ASCIIToUTF16("text");
 | 
| +    expected.form_control_type = "text";
 | 
|      expected.max_length = WebInputElement::defaultMaxLength();
 | 
|  
 | 
|      expected.name = ASCIIToUTF16("middlename");
 | 
| @@ -732,7 +691,7 @@ TEST_F(FormAutofillTest, FindForm) {
 | 
|    ASSERT_EQ(4U, fields.size());
 | 
|  
 | 
|    FormFieldData expected;
 | 
| -  expected.form_control_type = ASCIIToUTF16("text");
 | 
| +  expected.form_control_type = "text";
 | 
|    expected.max_length = WebInputElement::defaultMaxLength();
 | 
|  
 | 
|    expected.name = ASCIIToUTF16("firstname");
 | 
| @@ -746,7 +705,9 @@ TEST_F(FormAutofillTest, FindForm) {
 | 
|  
 | 
|    expected.name = ASCIIToUTF16("email");
 | 
|    expected.value = ASCIIToUTF16("john@example.com");
 | 
| +  expected.autocomplete_attribute = "off";
 | 
|    EXPECT_FORM_FIELD_DATA_EQUALS(expected, fields[2]);
 | 
| +  expected.autocomplete_attribute = std::string();  // reset
 | 
|  
 | 
|    expected.name = ASCIIToUTF16("phone");
 | 
|    expected.value = ASCIIToUTF16("1.800.555.1234");
 | 
| @@ -764,7 +725,7 @@ TEST_F(FormAutofillTest, FindForm) {
 | 
|    const std::vector<FormFieldData>& fields2 = form2.fields;
 | 
|    ASSERT_EQ(3U, fields2.size());
 | 
|  
 | 
| -  expected.form_control_type = ASCIIToUTF16("text");
 | 
| +  expected.form_control_type = "text";
 | 
|    expected.max_length = WebInputElement::defaultMaxLength();
 | 
|  
 | 
|    expected.name = ASCIIToUTF16("firstname");
 | 
| @@ -821,7 +782,7 @@ TEST_F(FormAutofillTest, FillForm) {
 | 
|    ASSERT_EQ(7U, fields.size());
 | 
|  
 | 
|    FormFieldData expected;
 | 
| -  expected.form_control_type = ASCIIToUTF16("text");
 | 
| +  expected.form_control_type = "text";
 | 
|    expected.max_length = WebInputElement::defaultMaxLength();
 | 
|  
 | 
|    expected.name = ASCIIToUTF16("firstname");
 | 
| @@ -948,7 +909,7 @@ TEST_F(FormAutofillTest, PreviewForm) {
 | 
|    ASSERT_EQ(4U, fields.size());
 | 
|  
 | 
|    FormFieldData expected;
 | 
| -  expected.form_control_type = ASCIIToUTF16("text");
 | 
| +  expected.form_control_type = "text";
 | 
|    expected.max_length = WebInputElement::defaultMaxLength();
 | 
|  
 | 
|    expected.name = ASCIIToUTF16("firstname");
 | 
| @@ -1353,32 +1314,33 @@ TEST_F(FormAutofillTest, LabelsInferredFromPreviousTD) {
 | 
|  // inferred.
 | 
|  // Also <!-- comment --> is excluded.
 | 
|  TEST_F(FormAutofillTest, LabelsInferredFromTableWithSpecialElements) {
 | 
| -  std::vector<string16> labels, names, values, control_types;
 | 
| +  std::vector<string16> labels, names, values;
 | 
| +  std::vector<std::string> control_types;
 | 
|  
 | 
|    labels.push_back(ASCIIToUTF16("* First Name"));
 | 
|    names.push_back(ASCIIToUTF16("firstname"));
 | 
|    values.push_back(ASCIIToUTF16("John"));
 | 
| -  control_types.push_back(ASCIIToUTF16("text"));
 | 
| +  control_types.push_back("text");
 | 
|  
 | 
|    labels.push_back(ASCIIToUTF16("* Middle Name"));
 | 
|    names.push_back(ASCIIToUTF16("middlename"));
 | 
|    values.push_back(ASCIIToUTF16("Joe"));
 | 
| -  control_types.push_back(ASCIIToUTF16("text"));
 | 
| +  control_types.push_back("text");
 | 
|  
 | 
|    labels.push_back(ASCIIToUTF16("* Last Name"));
 | 
|    names.push_back(ASCIIToUTF16("lastname"));
 | 
|    values.push_back(ASCIIToUTF16("Smith"));
 | 
| -  control_types.push_back(ASCIIToUTF16("text"));
 | 
| +  control_types.push_back("text");
 | 
|  
 | 
|    labels.push_back(ASCIIToUTF16("* Country"));
 | 
|    names.push_back(ASCIIToUTF16("country"));
 | 
|    values.push_back(ASCIIToUTF16("US"));
 | 
| -  control_types.push_back(ASCIIToUTF16("select-one"));
 | 
| +  control_types.push_back("select-one");
 | 
|  
 | 
|    labels.push_back(ASCIIToUTF16("* Email"));
 | 
|    names.push_back(ASCIIToUTF16("email"));
 | 
|    values.push_back(ASCIIToUTF16("john@example.com"));
 | 
| -  control_types.push_back(ASCIIToUTF16("text"));
 | 
| +  control_types.push_back("text");
 | 
|  
 | 
|    ExpectLabelsAndTypes(
 | 
|        "<FORM name=\"TestForm\" action=\"http://cnn.com\" method=\"post\">"
 | 
| @@ -1899,7 +1861,7 @@ TEST_F(FormAutofillTest, FillFormMaxLength) {
 | 
|    ASSERT_EQ(3U, fields.size());
 | 
|  
 | 
|    FormFieldData expected;
 | 
| -  expected.form_control_type = ASCIIToUTF16("text");
 | 
| +  expected.form_control_type = "text";
 | 
|  
 | 
|    expected.name = ASCIIToUTF16("firstname");
 | 
|    expected.max_length = 5;
 | 
| @@ -1935,7 +1897,7 @@ TEST_F(FormAutofillTest, FillFormMaxLength) {
 | 
|    const std::vector<FormFieldData>& fields2 = form2.fields;
 | 
|    ASSERT_EQ(3U, fields2.size());
 | 
|  
 | 
| -  expected.form_control_type = ASCIIToUTF16("text");
 | 
| +  expected.form_control_type = "text";
 | 
|  
 | 
|    expected.name = ASCIIToUTF16("firstname");
 | 
|    expected.value = ASCIIToUTF16("Broth");
 | 
| @@ -1992,7 +1954,7 @@ TEST_F(FormAutofillTest, FillFormNegativeMaxLength) {
 | 
|    ASSERT_EQ(3U, fields.size());
 | 
|  
 | 
|    FormFieldData expected;
 | 
| -  expected.form_control_type = ASCIIToUTF16("text");
 | 
| +  expected.form_control_type = "text";
 | 
|    expected.max_length = WebInputElement::defaultMaxLength();
 | 
|  
 | 
|    expected.name = ASCIIToUTF16("firstname");
 | 
| @@ -2069,7 +2031,7 @@ TEST_F(FormAutofillTest, FillFormEmptyName) {
 | 
|    ASSERT_EQ(3U, fields.size());
 | 
|  
 | 
|    FormFieldData expected;
 | 
| -  expected.form_control_type = ASCIIToUTF16("text");
 | 
| +  expected.form_control_type = "text";
 | 
|    expected.max_length = WebInputElement::defaultMaxLength();
 | 
|  
 | 
|    expected.name = ASCIIToUTF16("firstname");
 | 
| @@ -2100,7 +2062,7 @@ TEST_F(FormAutofillTest, FillFormEmptyName) {
 | 
|    const std::vector<FormFieldData>& fields2 = form2.fields;
 | 
|    ASSERT_EQ(3U, fields2.size());
 | 
|  
 | 
| -  expected.form_control_type = ASCIIToUTF16("text");
 | 
| +  expected.form_control_type = "text";
 | 
|    expected.max_length = WebInputElement::defaultMaxLength();
 | 
|  
 | 
|    expected.name = ASCIIToUTF16("firstname");
 | 
| @@ -2155,7 +2117,7 @@ TEST_F(FormAutofillTest, FillFormEmptyFormNames) {
 | 
|    ASSERT_EQ(3U, fields.size());
 | 
|  
 | 
|    FormFieldData expected;
 | 
| -  expected.form_control_type = ASCIIToUTF16("text");
 | 
| +  expected.form_control_type = "text";
 | 
|    expected.max_length = WebInputElement::defaultMaxLength();
 | 
|  
 | 
|    expected.name = ASCIIToUTF16("apple");
 | 
| @@ -2241,7 +2203,7 @@ TEST_F(FormAutofillTest, ThreePartPhone) {
 | 
|    ASSERT_EQ(4U, fields.size());
 | 
|  
 | 
|    FormFieldData expected;
 | 
| -  expected.form_control_type = ASCIIToUTF16("text");
 | 
| +  expected.form_control_type = "text";
 | 
|    expected.max_length = WebInputElement::defaultMaxLength();
 | 
|  
 | 
|    expected.label = ASCIIToUTF16("Phone:");
 | 
| @@ -2300,7 +2262,7 @@ TEST_F(FormAutofillTest, MaxLengthFields) {
 | 
|    ASSERT_EQ(6U, fields.size());
 | 
|  
 | 
|    FormFieldData expected;
 | 
| -  expected.form_control_type = ASCIIToUTF16("text");
 | 
| +  expected.form_control_type = "text";
 | 
|  
 | 
|    expected.label = ASCIIToUTF16("Phone:");
 | 
|    expected.name = ASCIIToUTF16("dayphone1");
 | 
| @@ -2374,7 +2336,7 @@ TEST_F(FormAutofillTest, FillFormNonEmptyField) {
 | 
|    ASSERT_EQ(3U, fields.size());
 | 
|  
 | 
|    FormFieldData expected;
 | 
| -  expected.form_control_type = ASCIIToUTF16("text");
 | 
| +  expected.form_control_type = "text";
 | 
|    expected.max_length = WebInputElement::defaultMaxLength();
 | 
|  
 | 
|    expected.name = ASCIIToUTF16("firstname");
 | 
| @@ -2483,7 +2445,7 @@ TEST_F(FormAutofillTest, ClearFormWithNode) {
 | 
|    ASSERT_EQ(4U, fields2.size());
 | 
|  
 | 
|    FormFieldData expected;
 | 
| -  expected.form_control_type = ASCIIToUTF16("text");
 | 
| +  expected.form_control_type = "text";
 | 
|    expected.max_length = WebInputElement::defaultMaxLength();
 | 
|  
 | 
|    expected.name = ASCIIToUTF16("firstname");
 | 
| @@ -2496,7 +2458,9 @@ TEST_F(FormAutofillTest, ClearFormWithNode) {
 | 
|  
 | 
|    expected.name = ASCIIToUTF16("noAC");
 | 
|    expected.value = string16();
 | 
| +  expected.autocomplete_attribute = "off";
 | 
|    EXPECT_FORM_FIELD_DATA_EQUALS(expected, fields2[2]);
 | 
| +  expected.autocomplete_attribute = std::string();  // reset
 | 
|  
 | 
|    expected.name = ASCIIToUTF16("notenabled");
 | 
|    expected.value = ASCIIToUTF16("no clear");
 | 
| @@ -2561,19 +2525,19 @@ TEST_F(FormAutofillTest, ClearFormWithNodeContainingSelectOne) {
 | 
|  
 | 
|    expected.name = ASCIIToUTF16("firstname");
 | 
|    expected.value = string16();
 | 
| -  expected.form_control_type = ASCIIToUTF16("text");
 | 
| +  expected.form_control_type = "text";
 | 
|    expected.max_length = WebInputElement::defaultMaxLength();
 | 
|    EXPECT_FORM_FIELD_DATA_EQUALS(expected, fields2[0]);
 | 
|  
 | 
|    expected.name = ASCIIToUTF16("lastname");
 | 
|    expected.value = string16();
 | 
| -  expected.form_control_type = ASCIIToUTF16("text");
 | 
| +  expected.form_control_type = "text";
 | 
|    expected.max_length = WebInputElement::defaultMaxLength();
 | 
|    EXPECT_FORM_FIELD_DATA_EQUALS(expected, fields2[1]);
 | 
|  
 | 
|    expected.name = ASCIIToUTF16("state");
 | 
|    expected.value = ASCIIToUTF16("?");
 | 
| -  expected.form_control_type = ASCIIToUTF16("select-one");
 | 
| +  expected.form_control_type = "select-one";
 | 
|    expected.max_length = 0;
 | 
|    EXPECT_FORM_FIELD_DATA_EQUALS(expected, fields2[2]);
 | 
|  
 | 
| @@ -2890,19 +2854,19 @@ TEST_F(FormAutofillTest, SelectOneAsText) {
 | 
|  
 | 
|    expected.name = ASCIIToUTF16("firstname");
 | 
|    expected.value = ASCIIToUTF16("John");
 | 
| -  expected.form_control_type = ASCIIToUTF16("text");
 | 
| +  expected.form_control_type = "text";
 | 
|    expected.max_length = WebInputElement::defaultMaxLength();
 | 
|    EXPECT_FORM_FIELD_DATA_EQUALS(expected, fields[0]);
 | 
|  
 | 
|    expected.name = ASCIIToUTF16("lastname");
 | 
|    expected.value = ASCIIToUTF16("Smith");
 | 
| -  expected.form_control_type = ASCIIToUTF16("text");
 | 
| +  expected.form_control_type = "text";
 | 
|    expected.max_length = WebInputElement::defaultMaxLength();
 | 
|    EXPECT_FORM_FIELD_DATA_EQUALS(expected, fields[1]);
 | 
|  
 | 
|    expected.name = ASCIIToUTF16("country");
 | 
|    expected.value = ASCIIToUTF16("Albania");
 | 
| -  expected.form_control_type = ASCIIToUTF16("select-one");
 | 
| +  expected.form_control_type = "select-one";
 | 
|    expected.max_length = 0;
 | 
|    EXPECT_FORM_FIELD_DATA_EQUALS(expected, fields[2]);
 | 
|  
 | 
| @@ -2922,19 +2886,19 @@ TEST_F(FormAutofillTest, SelectOneAsText) {
 | 
|  
 | 
|    expected.name = ASCIIToUTF16("firstname");
 | 
|    expected.value = ASCIIToUTF16("John");
 | 
| -  expected.form_control_type = ASCIIToUTF16("text");
 | 
| +  expected.form_control_type = "text";
 | 
|    expected.max_length = WebInputElement::defaultMaxLength();
 | 
|    EXPECT_FORM_FIELD_DATA_EQUALS(expected, fields[0]);
 | 
|  
 | 
|    expected.name = ASCIIToUTF16("lastname");
 | 
|    expected.value = ASCIIToUTF16("Smith");
 | 
| -  expected.form_control_type = ASCIIToUTF16("text");
 | 
| +  expected.form_control_type = "text";
 | 
|    expected.max_length = WebInputElement::defaultMaxLength();
 | 
|    EXPECT_FORM_FIELD_DATA_EQUALS(expected, fields[1]);
 | 
|  
 | 
|    expected.name = ASCIIToUTF16("country");
 | 
|    expected.value = ASCIIToUTF16("AL");
 | 
| -  expected.form_control_type = ASCIIToUTF16("select-one");
 | 
| +  expected.form_control_type = "select-one";
 | 
|    expected.max_length = 0;
 | 
|    EXPECT_FORM_FIELD_DATA_EQUALS(expected, fields[2]);
 | 
|  }
 | 
| 
 |