'Literals are raw bytes. Testing that raw bytes are processed right.'

def testLiteralExpressionIsProcessedCorrectly(self):

    self.Open('/')
    self.Click('css=a[grrtarget=hunts]')
    self.Click('css=button[name=NewHunt]')
    self.WaitUntil(self.IsTextPresent, 'What    to    run?')
    self.WaitUntil(self.IsElementPresent, 'css=#_Filesystem    >    i.jstree-icon')
    self.Click('css=#_Filesystem    >    i.jstree-icon')
    self.Click('link=File    Finder')
    self.Click("css=label:contains('Conditions')    ~    *    button")
    self.Select("css=label:contains('Condition    type')    ~    *    select", 'Contents    literal    match')
    self.Type("css=label:contains('Literal')    ~    *    input", 'foo\\x0d\\xc8bar')
    self.Click('css=grr-new-hunt-wizard-form    button.Next')
    self.WaitUntil(self.IsTextPresent, 'Output    Processing')
    self.Click('css=grr-new-hunt-wizard-form    button.Next')
    self.WaitUntil(self.IsTextPresent, 'Where    to    run?')
    self.Click('css=grr-new-hunt-wizard-form    button.Next')
    self.WaitUntil(self.IsTextPresent, 'Review')
    self.WaitUntil(self.IsTextPresent, file_finder.FileFinder.__name__)
    self.WaitUntil(self.IsTextPresent, 'foo\\x0d\\xc8bar')
    self.Click('css=grr-new-hunt-wizard-form    button.Next')
    self.WaitUntil(self.IsTextPresent, 'Created    Hunt')
    self.Click('css=button.Next')
    hunts_root = aff4.FACTORY.Open('aff4:/hunts', token=self.token)
    hunts_list = list(hunts_root.OpenChildren())
    self.assertEqual(len(hunts_list), 1)
    hunt = hunts_list[0]
    self.assertEqual(hunt.args.flow_runner_args.flow_name, file_finder.FileFinder.__name__)
    self.assertEqual(hunt.args.flow_args.conditions[0].contents_literal_match.literal, 'foo\r\xc8bar')
