Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(129)

Side by Side Diff: chrome/browser/ui/webui/browsing_history_handler_unittest.cc

Issue 2704283002: Speculatively deflake BrowsingHistoryHandler::MergeDuplicateResults on Android. (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/history/browsing_history_service_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 "chrome/browser/ui/webui/browsing_history_handler.h" 5 #include "chrome/browser/ui/webui/browsing_history_handler.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 #include <memory> 8 #include <memory>
9 #include <set> 9 #include <set>
10 #include <utility> 10 #include <utility>
(...skipping 22 matching lines...) Expand all
33 #include "content/public/browser/browser_thread.h" 33 #include "content/public/browser/browser_thread.h"
34 #include "content/public/browser/web_contents.h" 34 #include "content/public/browser/web_contents.h"
35 #include "content/public/test/test_browser_thread_bundle.h" 35 #include "content/public/test/test_browser_thread_bundle.h"
36 #include "content/public/test/test_web_ui.h" 36 #include "content/public/test/test_web_ui.h"
37 #include "net/http/http_status_code.h" 37 #include "net/http/http_status_code.h"
38 #include "testing/gtest/include/gtest/gtest.h" 38 #include "testing/gtest/include/gtest/gtest.h"
39 #include "url/gurl.h" 39 #include "url/gurl.h"
40 40
41 namespace { 41 namespace {
42 42
43 // Duplicates on the same day in the local timezone are removed, so set a
44 // baseline time in local time.
45 const base::Time baseline_time = base::Time::UnixEpoch().LocalMidnight();
46
47 base::Time PretendNow() { 43 base::Time PretendNow() {
48 base::Time::Exploded exploded_reference_time; 44 base::Time::Exploded exploded_reference_time;
49 exploded_reference_time.year = 2015; 45 exploded_reference_time.year = 2015;
50 exploded_reference_time.month = 1; 46 exploded_reference_time.month = 1;
51 exploded_reference_time.day_of_month = 2; 47 exploded_reference_time.day_of_month = 2;
52 exploded_reference_time.day_of_week = 5; 48 exploded_reference_time.day_of_week = 5;
53 exploded_reference_time.hour = 11; 49 exploded_reference_time.hour = 11;
54 exploded_reference_time.minute = 0; 50 exploded_reference_time.minute = 0;
55 exploded_reference_time.second = 0; 51 exploded_reference_time.second = 0;
56 exploded_reference_time.millisecond = 0; 52 exploded_reference_time.millisecond = 0;
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
334 const base::DictionaryValue* first_entry; 330 const base::DictionaryValue* first_entry;
335 ASSERT_TRUE(arg2->GetDictionary(0, &first_entry)); 331 ASSERT_TRUE(arg2->GetDictionary(0, &first_entry));
336 332
337 base::string16 title; 333 base::string16 title;
338 ASSERT_TRUE(first_entry->GetString("title", &title)); 334 ASSERT_TRUE(first_entry->GetString("title", &title));
339 335
340 ASSERT_EQ(0u, title.find(base::ASCIIToUTF16("http://loooo"))); 336 ASSERT_EQ(0u, title.find(base::ASCIIToUTF16("http://loooo")));
341 EXPECT_EQ(300u, title.size()); 337 EXPECT_EQ(300u, title.size());
342 } 338 }
343 #endif 339 #endif
OLDNEW
« no previous file with comments | « chrome/browser/history/browsing_history_service_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698