OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "base/base_switches.h" | 5 #include "base/base_switches.h" |
6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
7 #include "chrome/browser/extensions/extension_apitest.h" | 7 #include "chrome/browser/extensions/extension_apitest.h" |
8 #include "chrome/browser/extensions/extension_service.h" | |
9 #include "chrome/test/base/ui_test_utils.h" | |
8 #include "net/base/mock_host_resolver.h" | 10 #include "net/base/mock_host_resolver.h" |
9 | 11 |
10 class HistoryExtensionApiTest : public ExtensionApiTest { | 12 class HistoryExtensionApiTest : public ExtensionApiTest { |
11 public: | 13 public: |
12 virtual void SetUpInProcessBrowserTestFixture() { | 14 virtual void SetUpInProcessBrowserTestFixture() { |
13 ExtensionApiTest::SetUpInProcessBrowserTestFixture(); | 15 ExtensionApiTest::SetUpInProcessBrowserTestFixture(); |
14 | 16 |
15 host_resolver()->AddRule("www.a.com", "127.0.0.1"); | 17 host_resolver()->AddRule("www.a.com", "127.0.0.1"); |
16 host_resolver()->AddRule("www.b.com", "127.0.0.1"); | 18 host_resolver()->AddRule("www.b.com", "127.0.0.1"); |
17 | 19 |
18 ASSERT_TRUE(StartTestServer()); | 20 ASSERT_TRUE(StartTestServer()); |
19 } | 21 } |
20 }; | 22 }; |
21 | 23 |
24 IN_PROC_BROWSER_TEST_F(HistoryExtensionApiTest, GetMostVisited) { | |
25 ASSERT_TRUE(RunExtensionSubtest("history", "test1.html")) | |
26 << message_; | |
27 const Extension* extension = GetSingleLoadedExtension(); | |
28 ASSERT_TRUE(extension) << message_; | |
29 | |
30 // Navigate to the web pages multiple times to build up history. | |
31 ResultCatcher catcher; | |
32 ui_test_utils::NavigateToURL(browser(), | |
33 GURL(extension->GetResourceURL("test1.html"))); | |
Aaron Boodman
2012/03/20 02:24:24
It looks like these files don't do anything other
| |
34 ASSERT_TRUE(catcher.GetNextResult()); | |
35 | |
36 ui_test_utils::NavigateToURL(browser(), | |
37 GURL(extension->GetResourceURL("test1.html"))); | |
38 ASSERT_TRUE(catcher.GetNextResult()); | |
39 | |
40 ui_test_utils::NavigateToURL(browser(), | |
41 GURL(extension->GetResourceURL("test1.html"))); | |
42 ASSERT_TRUE(catcher.GetNextResult()); | |
43 | |
44 ui_test_utils::NavigateToURL(browser(), | |
45 GURL(extension->GetResourceURL("test2.html"))); | |
46 ASSERT_TRUE(catcher.GetNextResult()); | |
47 | |
48 ui_test_utils::NavigateToURL(browser(), | |
49 GURL(extension->GetResourceURL("test2.html"))); | |
50 ASSERT_TRUE(catcher.GetNextResult()); | |
51 | |
52 ui_test_utils::NavigateToURL(browser(), | |
53 GURL(extension->GetResourceURL("test2.html"))); | |
54 ASSERT_TRUE(catcher.GetNextResult()); | |
55 | |
56 ui_test_utils::NavigateToURL(browser(), | |
57 GURL(extension->GetResourceURL("test3.html"))); | |
58 ASSERT_TRUE(catcher.GetNextResult()); | |
59 | |
60 ui_test_utils::NavigateToURL(browser(), | |
61 GURL(extension->GetResourceURL("test3.html"))); | |
62 ASSERT_TRUE(catcher.GetNextResult()); | |
63 | |
64 // Finally, call the getMostVisited tests. | |
65 ui_test_utils::NavigateToURL(browser(), | |
66 GURL(extension->GetResourceURL("get_most_visited.html"))); | |
67 ASSERT_TRUE(catcher.GetNextResult()); | |
68 } | |
69 | |
22 // Full text search indexing sometimes exceeds a timeout. | 70 // Full text search indexing sometimes exceeds a timeout. |
23 // Fix this as part of crbug/76170. | 71 // Fix this as part of crbug/76170. |
24 IN_PROC_BROWSER_TEST_F(HistoryExtensionApiTest, DISABLED_MiscSearch) { | 72 IN_PROC_BROWSER_TEST_F(HistoryExtensionApiTest, DISABLED_MiscSearch) { |
25 ASSERT_TRUE(RunExtensionSubtest("history", "misc_search.html")) << message_; | 73 ASSERT_TRUE(RunExtensionSubtest("history", "misc_search.html")) << message_; |
26 } | 74 } |
27 | 75 |
28 IN_PROC_BROWSER_TEST_F(HistoryExtensionApiTest, TimedSearch) { | 76 IN_PROC_BROWSER_TEST_F(HistoryExtensionApiTest, TimedSearch) { |
29 ASSERT_TRUE(RunExtensionSubtest("history", "timed_search.html")) << message_; | 77 ASSERT_TRUE(RunExtensionSubtest("history", "timed_search.html")) << message_; |
30 } | 78 } |
31 | 79 |
(...skipping 17 matching lines...) Expand all Loading... | |
49 // Fix this as part of crbug/76170. | 97 // Fix this as part of crbug/76170. |
50 #define MAYBE_SearchAfterAdd DISABLED_SearchAfterAdd | 98 #define MAYBE_SearchAfterAdd DISABLED_SearchAfterAdd |
51 #else | 99 #else |
52 #define MAYBE_SearchAfterAdd SearchAfterAdd | 100 #define MAYBE_SearchAfterAdd SearchAfterAdd |
53 #endif | 101 #endif |
54 | 102 |
55 IN_PROC_BROWSER_TEST_F(HistoryExtensionApiTest, MAYBE_SearchAfterAdd) { | 103 IN_PROC_BROWSER_TEST_F(HistoryExtensionApiTest, MAYBE_SearchAfterAdd) { |
56 ASSERT_TRUE(RunExtensionSubtest("history", "search_after_add.html")) | 104 ASSERT_TRUE(RunExtensionSubtest("history", "search_after_add.html")) |
57 << message_; | 105 << message_; |
58 } | 106 } |
OLD | NEW |