shell_nacl_browser_delegate_unittest.cc 1.1 KB

1234567891011121314151617181920212223242526272829
  1. // Copyright 2014 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #include "extensions/shell/browser/shell_nacl_browser_delegate.h"
  5. #include "base/strings/pattern.h"
  6. #include "base/strings/string_util.h"
  7. #include "content/public/test/browser_task_environment.h"
  8. #include "content/public/test/test_browser_context.h"
  9. #include "testing/gtest/include/gtest/gtest.h"
  10. namespace extensions {
  11. using ShellNaClBrowserDelegateTest = testing::Test;
  12. // Verifies that the returned version string has a valid format.
  13. TEST_F(ShellNaClBrowserDelegateTest, VersionString) {
  14. content::BrowserTaskEnvironment task_environment;
  15. content::TestBrowserContext browser_context;
  16. ShellNaClBrowserDelegate delegate(&browser_context);
  17. // Version should look like "1.2.3.4 (5)".
  18. std::string version = delegate.GetVersionString();
  19. EXPECT_TRUE(base::MatchPattern(version, "*.*.*.* (*)")) << "bad version "
  20. << version;
  21. }
  22. } // namespace extensions