chromium/chrome/renderer/autofill/page_passwords_analyser_browsertest.cc

// Copyright 2017 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "components/autofill/content/renderer/page_passwords_analyser.h"

#include "chrome/test/base/chrome_render_view_test.h"
#include "components/autofill/content/renderer/page_form_analyser_logger.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/web/web_document.h"
#include "third_party/blink/public/web/web_element_collection.h"
#include "third_party/blink/public/web/web_form_element.h"

namespace autofill {

namespace {

class MockPageFormAnalyserLogger : public PageFormAnalyserLogger {};

const char kExpectedDocumentationLink[] =;

const char kPasswordFieldNotInForm[] =;

const char kPasswordFormWithoutUsernameField[] =;

const char kElementsWithDuplicateIds[] =;

const char kPasswordFormTooComplex[] =;

const char kInferredPasswordAutocompleteAttributes[] =// Login form.
    "<form>"
    "   <input type='text'>"
    "   <input type='password'>"
    "</form>"
    // Registration form.
    "<form>"
    "   <input type='text'>"
    "   <input type='password'>"
    "   <input type='password'>"
    "</form>"
    // Change password form.
    "<form>"
    "   <input type='text'>"
    "   <input type='password'>"
    "   <input type='password'>"
    "   <input type='password'>"
    "</form>";

const char kInferredUsernameAutocompleteAttributes[] =// Login form.
    "<form>"
    "   <input type='text'>"
    "   <input type='password' autocomplete='current-password'>"
    "</form>"
    // Registration form.
    "<form>"
    "   <input type='text'>"
    "   <input type='password' autocomplete='new-password'>"
    "   <input type='password' autocomplete='new-password'>"
    "</form>"
    // Change password form with username.
    "<form>"
    "   <input type='text'>"
    "   <input type='password' autocomplete='current-password'>"
    "   <input type='password' autocomplete='new-password'>"
    "   <input type='password' autocomplete='new-password'>"
    "</form>";

const char kPasswordFieldsWithAndWithoutAutocomplete[] =;

const std::string AutocompleteSuggestionString(const std::string& suggestion) {}

}  // namespace

class PagePasswordsAnalyserTest : public ChromeRenderViewTest {};

TEST_F(PagePasswordsAnalyserTest, PasswordFieldNotInForm) {}

TEST_F(PagePasswordsAnalyserTest, PasswordFormWithoutUsernameField) {}

TEST_F(PagePasswordsAnalyserTest, ElementsWithDuplicateIds) {}

TEST_F(PagePasswordsAnalyserTest, PasswordFormTooComplex) {}

TEST_F(PagePasswordsAnalyserTest, InferredPasswordAutocompleteAttributes) {}

TEST_F(PagePasswordsAnalyserTest, InferredUsernameAutocompleteAttributes) {}

TEST_F(PagePasswordsAnalyserTest, PasswordFieldWithAndWithoutAutocomplete) {}

}  // namespace autofill