#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "chrome/renderer/searchbox/searchbox.h"
#include <stddef.h>
#include <map>
#include <string>
#include "chrome/common/search/instant_types.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "url/gurl.h"
namespace {
const char* kUrlString1 = …;
const char* kUrlString2 = …;
const char* kUrlString3 = …;
class MockIconURLHelper: public SearchBox::IconURLHelper { … };
MockIconURLHelper::MockIconURLHelper() { … }
MockIconURLHelper::~MockIconURLHelper() { … }
std::string MockIconURLHelper::GetMainFrameToken() const { … }
std::string MockIconURLHelper::GetURLStringFromRestrictedID(
InstantRestrictedID rid) const { … }
}
namespace internal {
bool ParseFrameTokenAndRestrictedId(const std::string& id_part,
std::string* frame_token_out,
InstantRestrictedID* rid_out);
bool ParseIconRestrictedUrl(const GURL& url,
std::string* param_part,
std::string* frame_token,
InstantRestrictedID* rid);
void TranslateIconRestrictedUrl(const GURL& transient_url,
const SearchBox::IconURLHelper& helper,
GURL* url);
TEST(SearchBoxUtilTest, ParseFrameTokenAndRestrictedIdSuccess) { … }
TEST(SearchBoxUtilTest, ParseFrameIdAndRestrictedIdFailure) { … }
TEST(SearchBoxUtilTest, ParseIconRestrictedUrlFaviconSuccess) { … }
TEST(SearchBoxUtilTest, ParseIconRestrictedUrlFailure) { … }
TEST(SearchBoxUtilTest, TranslateIconRestrictedUrlSuccess) { … }
}